Ryanair and its chief executive Michael O'Leary have reached a $5m settlement of a lawsuit accusing them of defrauding shareholders by downplaying the willingness of Europe's largest budget airline to recognise labour unions.

The preliminary all-cash settlement was reached after mediation, and was filed yesterday in the US District Court in Manhattan.

It requires a judge's approval, and Ryanair denied wrongdoing.

Shareholders accused Ryanair and O'Leary, its CEO since 1994, of inflating the carrier's stock price by trying to mislead them into believing they would not welcome unions, the recognition of which could boost costs and reduce profits.

The lawsuit cited, among other statements, Mr O'Leary's comment at Ryanair's 2017 annual general meeting that hell would "freeze over" before the Dublin-based carrier accepted unions.

Shareholders also challenged Ryanair's claims that it had enough pilots and maintained excellent labour relations, when it actually faced a pilot shortage and offered in December 2017 to recognise pilot unions to avert a possible strike.

Ryanair's stock price fell as its labour issues became known, causing investor losses, the lawsuit said.

In a statement, Ryanair said it welcomed the settlement, and said it was "in the interest of all shareholders."

"The total settlement amount is $5m, which is considerably less than the legal costs that would have been incurred had this action gone all the way to trial," a spokesperson said.

"Ryanair contends there was no lawful basis for this claim, but that the settlement is in the interest of all shareholders due to the very modest settlement amount."

The settlement covers investors in Ryanair's American depositary shares from May 30 2017 to September 28 2018.

The lead plaintiff is an Alabama pension fund, the City of Birmingham Firemen's and Policemen's Supplemental Pension System.

Its lawyers may seek up to $1.5 million to cover fees and expenses, court papers show.