Theresa May, the former UK prime minister, launched an extraordinary attack on Boris Johnson on Tuesday, accusing her successor of moral failure and diminishing Britain’s standing in global affairs.

Mrs May, who left office in July 2019 after successively failing to pass a Brexit withdrawal agreement through parliament, has made steady but low-key criticisms of her successor in parliamentary debates over several areas of policy.

But in an article for the Daily Mail marking the inauguration of Joe Biden as US president, she sharply criticised two of Mr Johnson’s foreign policy positions — breaking the Brexit withdrawal agreement and cutting overseas aid — while warning that the UK must “live up to our values”.

“Threatening to break international law by going back on a treaty we had just signed and abandoning our position of global moral leadership as the only major economy to meet both the 2 per cent defence spending target and the 0.7 per cent international aid target were not actions which, in my view, raised our credibility in the eyes of the world,” she wrote.

All five of Britain’s living past prime ministers — John Major, Tony Blair, Gordon Brown, David Cameron and Mrs May — have attacked the decision to cut overseas aid to 0.5 per cent, which the Johnson government has argued is made necessary by the burden coronavirus has put on the UK’s finances.

Mrs May argued that the UK had to command respect based on its actions. “Other countries listen to what we say not simply because of who we are, but because of what we do. The world does not owe us a prominent place on its stage . . . so, we should do nothing which signals a retreat from our global commitments.”

Such an explicit attack on a sitting prime minister from their predecessor in the same party is rare. Mrs May’s blue-on-blue intervention will recall memories of Ted Heath, who frequently criticised his successor Margaret Thatcher from the Tory backbenches after losing the October 1974 general election.

Mrs May’s intervention follows Downing Street’s efforts to distance itself from the Trump administration following the mob attack on Capitol Hill. Mr Johnson has previously praised the outgoing president but has more recently sought to loosen relations.

Mr Johnson will congratulate Mr Biden on Wednesday on his inauguration, saying he looked forward to “working closely with his new administration as we defeat Covid and build back better from the pandemic”.

“In our fight against Covid and across climate change, defence, security and in promoting and defending democracy, our goals are the same and our nations will work hand in hand to achieve them,” he said.

Mrs May, who served as home secretary in Mr Cameron’s governments before entering Downing Street after the Brexit referendum in 2016, said the Biden presidency was a “golden opportunity” for the UK and predicted he would be a “more predictable and reliable partner”.

“He is an experienced hand, having served eight years as a diplomatically engaged vice-president. With Donald Trump, I never knew what to expect — from being offered, sometimes literally, the hand of friendship to hearing him question core tenets of the transatlantic alliance,” she wrote.

“When a British prime minister walks out for a joint press conference with the world’s media unsure if the United States president standing next to her will agree that Nato is a bulwark of our collective defence, you know you are living in extraordinary times.”