Former home secretary Alan Johnson has revealed that he was prepared to lead the Labour party into coalition with the Liberal Democrats in 2010 – even though it was "a shit job". In an interview with the Guardian, the MP for Hull West and Hessle said that when the Lib Dems came to talk to Labour in May 2010, just after the general election resulted in the first hung parliament in 36 years, he believed the two parties would form a coalition. Talks between the Conservatives and the Lib Dems had broken down.

"The condition they laid was that Gordon [Brown] had to go and we all knew that anyway … I thought, well, if there's a leadership election in these circumstances I'll stand."

Johnson said Labour and the Lib Dems looked as if they were on the verge of resolving major differences. "We'd talked to them about proportional representation, and Andrew Adonis was leading our approach with David Laws for the Lib Dems, and we'd worked out our policy on all these things. I was asked, as still the home secretary, would you bend on ID cards, and we'd put all our bits in, and we thought we could get a deal here."

Johnson said it would have made sense for him to lead the party because it was a poisoned chalice and they did not want to sacrifice younger talent. "I was home secretary. David Miliband was foreign secretary. Alistair Darling was chancellor. It would have been one of us that were expected to go forward. It wasn't the right way for David – or Ed Miliband, or whoever else was going to come in – to take over. It was a shit job to be done for a period of time." There had been rumours before the election that Johnson was going to challenge Brown for the leadership. But Johnson said this was nonsense, and that he believed Brown had performed admirably on the world stage. "That would have been an ignoble thing to do to a guy who had been grappling with these issues. I don't think it would have worked any way. And it certainly wouldn't have been me who led the charge."

In 2007, when asked about his ambition to lead the party on Desert Island Discs, Johnson had told Kirsty Young that he did not have the necessary qualities. He told the Guardian he regretted saying this, and that by 2010 after stints as health and home secretary he felt he did feel he had the ability to lead.

But history played out differently when the Conservative party offered a more attractive deal to the Lib Dems on the alternative vote. "On the Monday we really felt there was a deal there. By the Tuesday morning the Lib Dems came in and it was obvious they'd done the deal. I don't blame them for this. They played their cards right."

Asked how he would have fared as leader, Johnson said: "The coalition inherited growth and delivered a recession. And yet they act as if they inherited recession and delivered growth. It's an absolute disaster. So I don't think you would have found that situation if you were talking to Prime Minister Johnson."