Former Ontario premier Dalton McGuinty has officially resigned his seat in the legislature, calling it quits after 23 years as Ottawa South MPP.

He made the announcement Wednesday morning.

“The end of this session marks an opportune time for me to bring to a close my service to the people of Ottawa South as their member of provincial parliament,” he said in a written statement.

“To this end, I will today submit my resignation.”

McGuinty went on to say he left politics with his “idealism intact and a deep sense of gratitude for the opportunity to have served in public life.”

McGuinty was absent from the legislature Tuesday when the Liberals’ budget bill passed, averting a summer election.

He had only shown up in the legislature twice since he was replaced by Kathleen Wynne as premier in February — both times for confidence votes.

When he stepped down as premier Oct. 15, McGuinty said he was planning to stay MPP for Ottawa South until the next provincial election.

Following the approval of the minority Liberals’ budget Tuesday, Wynne suggested the Liberal government could survive for another year.

Political affairs specialist John Stall says the survival of the Liberal government may explain why McGuinty is resigning his seat.

“His intent was to not run in the next election so if that budget was not going to pass and the NDP was going to trigger [an election], he would have made that decision and stepped down rather than go into a campaign,” Stall said.

McGuinty’s resignation comes as Opposition parties demand he appear again before a legislative committee probing the GTA gas plants controversy and deleted emails about it.

The OPP has launched an investigation into the email scandal, with officers showing up at Queen’s Park Wednesday.

PC Leader Tim Hudak didn’t mince words when it came to his view of McGuinty’s legacy.

“Clearly this is a legacy of debt, of waste, and he’s walking out under a cloud of corruption,” Hudak said.

Wynne said she had “always valued Dalton’s counsel and look forward to our continued discussions as I endeavour to build on his many wise actions.”

“Dalton has been an unwavering political force since I first entered provincial politics, and I thank him, Terri and their children for the sacrifices they have made. I wish him well in the next phase of his impressive career.”

McGuinty’s departure makes the third vacant provincial riding.

Wynne must call byelections by mid-August in Windsor and London to replace former finance minister Dwight Duncan and former energy minister Chris Bentley.

“Dalton McGuinty served Ontario with integrity throughout his years in public office. He will go down as one of our greatest premiers,” Duncan tweeted Tuesday night.

The former premier served as the MPP for Ottawa South for 23 years, taking over the seat held by his father, Dalton McGuinty Sr., and held the premier’s job for a decade starting in 2003.