Gordon Brown agreed today to give evidence to the Iraq Inquiry before the general election.
The Prime Minister wrote to inquiry chairman Sir John Chilcot this morning offering to appear as a witness next month or in March.
Mr Brown wrote: "You have proposed a range of dates in the next two months.
"I will be happy to agree a date which is to the convenience of the inquiry."
An inquiry spokesman said the Prime Minister would probably give evidence in late February or early March.
The dramatic switch followed mounting political pressure for Mr Brown to face questioning before the election - due by June 3 - over claims that, as Chancellor, he starved the Armed Forces of essential funds.
The Prime Minister repeatedly declared he had "nothing to hide" and was happy to give evidence any time but timetabling was entirely a matter for the inquiry.
Sir John had ruled the Prime Minister's evidence, and that of Foreign Secretary David Miliband and International Development Secretary Douglas Alexander, should be delayed to keep party politics out of the probe.
On Wednesday Mr Brown told MPs he had written to the inquiry chairman reiterating his willingness "to give evidence at any time".
Sir John replied to the Prime Minister last night to say his team had agreed he could be grilled on his role in the war before the nation votes.
But he stressed: "If, of course, in the meantime a general election is called, we would need to postpone the hearing, as we have always made clear."
Opening today's inquiry hearing, Sir John said: "From the outset we have made it clear that we wish to stay outside party politics.
"Ours is a serious task, and we wish to collect our evidence in a way in which our witnesses will be open about what happened and give their evidence fully without the hearings being used as a platform for political advantage by any party.
"It was for this reason that my colleagues and I made a decision announced before Christmas that we would not call Ministers currently serving in posts relevant to Iraq until after the election.
"The Prime Minister wrote to me earlier this week to say that he was prepared to give evidence whenever we saw fit.
"In my reply to the Prime Minister yesterday evening, I said that as a matter of fairness the committee concluded we should offer the Prime Minister, if he wished to take it up, the opportunity for him, for David Miliband as Foreign Secretary and Douglas Alexander as International Development Secretary to attend hearings before the general election.
"The Prime Minister replied to me this morning to say that he will be happy to agree dates from a range we have proposed over the next two months."
The spokesman for the inquiry said Mr Miliband and Mr Alexander had not yet indicated whether they wanted to give evidence before the election.