LISBON (Reuters) - Portugal's human rights ombudswoman criticised the prosecutor's office on Monday for an apparent "gross error" in a graft investigation that led to the fall of a majority Socialist government in November.

Prime Minister Antonio Costa resigned over the investigation into alleged illegalities in his administration's handling of lithium and hydrogen projects, triggering an election that last month produced an even more fragmented parliament and brought to power a shaky centre-right government.

Costa, whose chief of staff was briefly arrested, has denied wrongdoing and was never charged with any crime.

"Like all citizens, I'm deeply concerned about everything that has happened, I'm perplexed ... I think we will have to think maturely as a country about how we got here," Maria Lucia Amaral told Radio Renascença.

The case has largely fallen apart as a judge dropped the corruption charges against several people who were formally accused, while Lisbon's Court of Appeal in February said the related investigation targeting Costa was based on "deductions and speculations" and not any evidence.

Critics of the public prosecutor's office have accused it of having interfered politically without having a watertight case.

Lucia Amaral said that "everything indicates that there was a gross error by the public prosecutor's office, with consequences visible to everyone".

Earlier this month, the prosecutor's office said it would continue to investigate unspecified "facts that could constitute crimes" around the former government's handling of contracts and try to find those responsible.

Prosecutor General Lucilia Gago in late November rejected criticism from the Socialist Party that she or her office were responsible for Costa's resignation, saying it was based on his own assessment of his political position.

(Reporting by Sergio Goncalves; editing by Andrei Khalip and Alex Richardson)

By Sergio Goncalves