Two former Conservative prime ministers lobbied a Middle Eastern royal family to award a multibillion-dollar oil contract to a company headed by a major Tory donor, the Guardian has established.

In March 2017, while in Downing Street, Theresa May wrote to the Bahraini prime minister to support the oil firm Petrofac while it was bidding to win the contract from the Gulf state.

Two months earlier, and just six months after stepping down as prime minister, David Cameron promoted the company during a two-day visit to Bahrain where he met the state’s crown prince.

Cameron was flown back to Britain on a plane belonging to Ayman Asfari, Petrofac’s co-founder, chief executive and largest shareholder. Petrofac did not ultimately win the contract.

Asfari and his wife, Sawsan, have donated almost £800,000 to the Conservative party since 2009. The donations were made in a personal capacity.

Documents obtained by the Guardian raise questions about how governments should best manage the perceived potential conflicts of interest generated by donations from business figures to political parties.

The government said it was routine for ministers to support British businesses bidding for major foreign contracts. Petrofac said official support had been obtained through entirely proper channels.

The Serious Fraud Office (SFO) has been investigating Petrofac over suspected bribery, corruption and money laundering for at least two years.

May’s support for Petrofac’s bid is detailed in documents released under the Freedom of Information Act.

In 2017, Petrofac requested a meeting with Liam Fox, then international trade secretary, “as part of their ongoing relationship” with the British government, according to the documents.

On 8 March, Fox wrote to May telling her that Asfari had “requested government support for a bid he is making together with a US-based company. The bid is for a major expansion of the Bahraini national oil company, Bapco refinery. The overall project is one of the largest ever in Bahrain at approximately $5bn.”

Fox said four consortiums were bidding for the contract and those bids were soon to be evaluated. “Mr Asfari believes that high level government support could make a substantial difference.”

He asked May to send a letter to the Bahraini prime minister, Prince Khalifa bin Salman Al Khalifa. Six days later, after Asfari met Fox in his Whitehall office, May wrote to Prince Khalifa “in support of” Petrofac’s bid.

“I am certain that Petrofac will do everything possible to deliver the most attractive techno-commercial offer for the project,” the prime minister wrote.

She said that “given the strategic importance of this project for Bahrain and for the economic relationship between our two countries”, Fox “has committed to follow and support this project to ensure that it receives the fullest commitment” of the British government.

Petrofac said it sought British government support for landing the contract through Britain’s ambassador in Bahrain, in line with common practice.

The Department for International Trade, speaking on behalf of May and Fox, said: “The support Petrofac received from the then prime minister and the then trade secretary followed the correct process, and was carried out with due propriety throughout. Government supports British business at home and abroad, including backing companies when they bid for international opportunities.”

Cameron visited Bahrain on 10 and 11 January 2017 on his way back from China. His office said it was an opportunity to visit Crown Prince Salman bin Hamad Al Khalifa after the cancellation of a scheduled visit while he had been prime minister.

His office said he carried out a “wide-ranging schedule of engagements and visits organised with the support of the UK’s ambassador to Bahrain, who accompanied Mr Cameron for part of the programme”.

“While visiting the country, Mr Cameron took the opportunity to help promote the interests of a British-based company. This was done in coordination with the UK government at the time.

“Mr Cameron, both as prime minister and subsequently, has been an enthusiastic advocate for British businesses around the world. He was not paid anything for this engagement and his support for the company had nothing whatsoever to do with donations made to the Conservative party.” Asfari did not accompany Cameron on the trip.

Foreign Office memos record that Cameron visited the headquarters of the Bahrain Economic Development Board. May’s letter outlined how Petrofac proposed to work with the board to help train Bahraini engineers.

A spokesperson for Petrofac said the firm “does not make political donations. Any donations by Ayman Asfari and his family are made in a strictly personal capacity.” The spokesperson stressed that no preferential treatment was given by the government to the company as a result of his personal donations.

Asfari, who reportedly has a fortune of about $1bn, co-founded Petrofac and has headed the multinational company for more than two decades. It designs and builds facilities for the oil and gas industry, employing 11,500 people in 24 countries.

Cameron appointed Asfari in 2014 as one of 43 prime minister’s business ambassadors, working with the British government to promote trade and investment.

A Whitehall memo prepared for Fox in 2017 described Asfari as being “very active as a business ambassador, which is greatly appreciated”. The business ambassadors scheme was closed by the government earlier this year.

In May 2017, the SFO announced it was investigating Petrofac. During its investigation the SFO arrested and interviewed Asfari under caution, among others. He was released without charge.

In February this year, David Lufkin, 51, a former Petrofac executive, pleaded guilty to 11 counts of offering bribes between 2011 and 2016 in an attempt to secure contracts in Saudi Arabia and Iraq. He has yet to be sentenced.