The internet giant Yahoo settled a lawsuit yesterday in relation to allegations that it helped China in a crackdown on two journalists.

Yahoo's decision to settle came a week after the company was criticised in Congress, with one congressman accusing the company of being moral pygmies.

The terms of the settlement were not disclosed and Yahoo did not admit fault but the company agreed to pay legal costs and apologise to the journalists' families.

Yahoo had earlier denied cooperating with the Chinese government in the prosecution of dissidents by helping to identify them. The company claimed it had no choice other than to comply with a request from Beijing to share information about the online activities of the journalists. Yahoo handed their email records to the Chinese government.

The journalists, Wang Xiaoning and Shi Tao, are serving 10-year jail sentences. Wang was accused of "incitement to subvert state power" after he emailed electronic journals advocating democratic reform and establishment of a multiparty system to replace the present authoritarian state. Shi was charged with passing on information that was designated a state secret. They both sued Yahoo in April.

Wang's wife Yu Ling claimed Yahoo had turned over information that helped identify her husband and that he and others were "subjected to torture and cruel, inhuman or degrading treatment, including arbitrary, prolonged and indefinite detention, for expressing their free speech rights and for using the internet to communicate about democracy and human rights matters".

In Congress last week Tom Lantos, chairman of the House foreign affairs committee, told Yahoo: "While technologically and financially you are giants, morally you are pygmies."

After being informed of the settlement Lantos said yesterday: "It took a tongue-lashing from Congress before these hi-tech titans did the right thing," he said. "What a disgrace."

The case on behalf of the journalists and other dissidents arrested was brought by the Washington-based World Organisation for Human Rights USA.

After the congressional hearing, Jerry Yang, the chief executive of Yahoo, met members of the journalists' families, and apologised to Shi's mother.

Yang said yesterday: "After meeting with the families, it was clear to me what we had to do to make this right for them, for Yahoo and for the future. We are committed to making sure our actions match our values around the world." Yang, who was joint founder of the California-based company in 1994, said it was establishing a "human rights fund to provide humanitarian and legal aid to [online] dissidents".

The journalists' lawyer Morton Sklar, said Yahoo's will to fight the lawsuit evaporated after the congressional hearing.

Sklar said: "There was a dramatic change in their position and that was strong incentive to settle. They did not want to be on the wrong side of this issue."

The World Organisation for Human Rights said after the settlement the journalists are "serving 10-year prison sentences as a direct result of the information Yahoo provided to Chinese authorities" and that while the identities of only a few of those arrested have been made public, "it is suspected that hundreds more have been similarly affected".

Alibaba.com, China's biggest online commerce firm, has run Yahoo's mainland China operations since Yahoo bought a 40% stake in Alibaba in 2005. Yahoo says its stake doesn't give it control of the firm. Shi, a former writer for the financial publication Contemporary Business News, was jailed under state secrecy laws for allegedly providing an email which contained notes about a government memo on media restrictions to foreigners.