Laura Alvarez, the wife of Jeremy Corbyn, has said she regrets Labour failed to “pull together” to win elections, condemning the media and his opponents in the party on his last day as leader of the party.

In a rare public statement, Alvarez said it had been “incredibly hard” for her to watch her husband vilified by the media and even harder to watch him be attacked by his own party.

UK coronavirus live: Boris Johnson forced to self-isolate for longer; London's emergency Nightingale hospital opens Read more

“The brutal irony is that if we had pulled together, we would have been ready to lead the country rather than suffer more austerity under the Tories,” she wrote in the Mirror.

“My greatest wish ahead of the 2017 general election was that the party would stay together so that we could beat them. Unfortunately, my wish was not granted and I will forever think of that lost moment when we were so close to winning for the people of the United Kingdom.”

Corbyn is due to step down after five years as Labour leader on Saturday. The shadow Brexit secretary, Keir Starmer, is widely expected to win the race to replace him, which started – unofficially – after December’s general election, in which the party won its lowest number of seats since 1935.

Voting opened in the competition on 24 February and closed on Thursday. The three candidates – Starmer, Rebecca Long-Bailey and Lisa Nandy – have been asked to pre-record victory speeches to be issued as soon as the result is announced.

Alvarez said: “It has been incredibly hard for me to watch my husband vilified and to hear his words twisted by his political opponents and some in the media. It has been even harder to watch him be attacked by his own party.”

The human rights lawyer said Corbyn had told her the first thing he would do if he became prime minister after the 2019 election was to spend more money on the NHS.

“I read about the work that our amazing heroes in the NHS are doing during the coronavirus outbreak and only wish that the investment our health service needs had been offered long before now,” she said.

Alvarez said it had been the privilege of her life to meet people across the country as part of Corbyn’s work as Labour leader. “We are all part of the cosmos and we all have a part to play in rebuilding our movement.”

She thanked people who voted for Labour and supported her husband, and urged the party not to lose sight of its “commitment to socialism and the policies of the manifesto”.

“We know you shared our values. If equality, humanity, honesty and kindness is called Corbynism, then that’s all right with me,” she said.