TORONTO - Jim Flaherty was remembered Wednesday with equal measures of laughter and tears as Canada's political elite gathered to set aside their partisan differences and pay their final respects to the former finance minister.

Mourners donned green scarves, a tribute to Flaherty's Irish heritage, inside the majestic St. James Anglican cathedral in downtown Toronto as they celebrated the diminutive, combative politician, who died of a heart attack last week at the age of 64.

Flaherty converted to Anglicanism when he married his wife, Ontario MPP Christine Elliott, 28 years ago.

"What a sad time this is in the life of our country," said Prime Minister Stephen Harper, who began the proceedings with an upbeat personal tribute to his longtime political confidante.

Harper not only poked fun at himself by comparing his own popularity to Flaherty's — "I can't even get my friends to like me," the prime minister joked to gales of laughter from the congregation — but he revealed how his finance minister told him four years ago he wanted to leave politics. Flaherty finally quit last month.

Flaherty said in 2010 he wanted to return to the private sector in order to put more money aside for his family, Harper recalled, but was first insistent on ensuring the Canadian economy was out of the woods following the 2008 economic downturn.

"And every year after that, without any prompting from me, the call would come and Jim would say: 'Prime Minister, I'm still worried about the global economy and we're not yet in balance. I want to do one more budget.'"

Directly addressing Elliott and the couple's triplet sons, Harper said, "We have lost a partner in politics, but you have lost a partner in life."

Harper fought back tears twice during his remarks, which were otherwise a cheerful, light-hearted look back on the time he and Flaherty shared together in power on Parliament Hill.

"Occasionally, I imposed a final decision," Harper said of their periodic cabinet-table disputes.

"Occasionally I decided he was probably right. And occasionally, I decided he was wrong, but let him have his way because I just got so damn tired of arguing with him."

But as his eulogy drew to a close, Harper had to compose himself as he described the day he accepted Flaherty's resignation just a few short weeks ago.

"I told Jim that he had truly been over these eight years, in my judgment, the best finance minister in the world, if not indeed the best in our history," Harper said.

"I also wished him well in his next career ... and I told him not to be a stranger."

One of the most touching moments came when the prime minister directly addressed Flaherty's triplet sons, the 23-year-old John, Galen and Quinn.

"I lost my own father almost exactly 11 years ago, to the day," he said. "That period, I remember almost nothing of what I said or what was said to me, so powerful were the waves of emotion.

"But once that passed and perspective took hold, I came to appreciate my father's place in my life probably even more fully and deeply than if he were still here. And it is all good, and it will be all good for you."

Liberal Leader Justin Trudeau, NDP Leader Tom Mulcair and former prime ministers Brian Mulroney, Kim Campbell and John Turner were among those on hand for the funeral, as were various federal cabinet ministers, including John Baird, Peter MacKay, Jason Kenney and James Moore.

Harper and his wife, Laureen, arrived in advance of the cortege, followed by Gov. Gen. David Johnston and his wife. Harper exchanged pleasantries with Mulroney and shook hands with Ontario Premier Kathleen Wynne as they sat down.

At one point, Mulroney and an ailing Turner, famous political rivals, were seen to exchange smiles and nods.

A host of familiar faces from the Ontario legislature — former premier Ernie Eves and Conservative Leader Tim Hudak among them — were also present.

Flaherty's sister, Norah, told the story of how their mother once discovered him throwing pennies in the trash — a foreshadowing, perhaps, of his decision in 2012 to do away with the costly one-cent piece.

"When Mum asked Jim why he was throwing out the pennies, he said, 'They're not worth anything,'" she said. "Somewhat prophetic."

Harper and his wife were particularly emotional during Norah Flaherty's remarks, frequently dabbing their eyes as she spoke of what a loving and loyal brother he was to his seven siblings.

A sombre but composed Elliott was effusive in her praise of her husband.

"He was the most intelligent man I ever met, and his clarity of thought was unparalleled," she said.

"He was a proud Canadian who loved our great country, and even when his life became more difficult in the last year or so, he persevered until he was certain he would leave things in order for his successor."

Added Quinn, in a poignant message to his father: "Put your feet up, lay your head back, close your eyes and relax. We will take it from here."

Flaherty's death, which came less than a month after his retirement as minister, sent shock waves through the national capital, where flags have been flying at half-mast and the Peace Tower has been bathed in green light.

Labour Minister Kellie Leitch, a Flaherty confidante who rushed to his condo in an attempt to revive her friend and had dinner with him on the eve of his death, delivered a reading at the funeral on Wednesday.

Mark Carney, the former Bank of Canada governor who now heads the Bank of England, was also on hand at the funeral, which took place under tight security just blocks from Toronto's famed financial district, a favourite Flaherty stomping ground.

Toronto Mayor Rob Ford, whose friendship with Flaherty caused the diminutive finance minister some uncomfortable moments in the media spotlight last year, was also in attendance.

Before the proceedings got underway, a choir assembled behind the altar and an organist filled the chamber with hymnal music as mourners awaited the arrival of the cortege carrying Flaherty's casket. The towering archways of the cathedral were bathed in green light.

Large white tents were erected on the lawn of the cathedral. Across the street, a phalanx of TV cameras documented the arrival of family, friends and dignitaries.

Onlookers began gathering several hours before the ceremony was scheduled to begin. One man had his patriotism on full display, wearing a white jacket adorned with a red maple leaf and clutching a Canadian flag.

The busy downtown Toronto streets surrounding the church were closed to all vehicular traffic, except for streetcars.

The ceremonial journey of the casket began in Whitby, Ont., and proceeded along Highway 401, down the Don Valley Parkway and through downtown Toronto before its scheduled arrival at the church just before 3 p.m. ET.

Hundreds of dignitaries and citizens had lined up to pay their respects Tuesday at Whitby's Abilities Centre, which caters to the disabled and able-bodied alike. Harper arrived late in the day for a private viewing.

Flaherty's state funeral is the first such honour since 2011, when former NDP leader Jack Layton was laid to rest.

State funerals are customarily only given to current or former prime ministers, governors general, sitting cabinet ministers or members of the Royal Family.

Note to readers: This is a corrected story. A previous version mistakenly identified MPP Christine Elliott as an MP.

Also on HuffPost:

Loading Slideshow...
  • Quinn Flaherty speaks to his mother Christine Elliott during the state funeral for her late husband Jim Flaherty in Toronto on Wednesday, April 16, 2014. THE CANADIAN PRESS/Frank Gunn

  • Christine Elliott touches the casket of her late husband at the state funeral for the Jim Flaherty in Toronto on Wednesday, April 16, 2014. THE CANADIAN PRESS/Frank Gunn

  • Christine Elliott and her son Quinn walk by the casket of her late husband at the state funeral for the Jim Flaherty in Toronto on Wednesday, April 16, 2014. THE CANADIAN PRESS/Frank Gunn

  • Stephen Harper delivers the eulogy at the state funeral for Jim Flaherty in Toronto on Wednesday, April 16, 2014. THE CANADIAN PRESS/Frank Gunn

  • Prime Minister Stephen Harperwalks past the casket of Jim Flaherty during the during the former finance minister's state funeral in Toronto on Wednesday, April 16, 2014. THE CANADIAN PRESS/Frank Gunn

  • Christine Elliott, right to left, and her sons Quinn, John and Galen wait for the start of the state funeral for her late husband Jim Flaherty in Toronto on Wednesday, April 16, 2014. THE CANADIAN PRESS/Frank Gunn

  • Christine Elliott, right, and her sons wait for the start of the state funeral for her late husband Jim Flaherty in Toronto on Wednesday, April 16, 2014. THE CANADIAN PRESS/Frank Gunn

  • Christine Elliott, right, and her sons wait for the start of the state funeral for her late husband Jim Flaherty in Toronto on Wednesday, April 16, 2014. THE CANADIAN PRESS/Frank Gunn

  • Members of the RCMP carry the casket bearing Jim Flaherty as it arrives at his state funeral in Toronto on Wednesday April 16, 2014. THE CANADIAN PRESS/Chris Young

  • The casket carried by RCMP members carrying the late Jim Flaherty arrives at the church for the state funeral in Toronto on Wednesday, April 16, 2014. THE CANADIAN PRESS/Nathan Denette

  • Christine Elliott, right, widow of the late Jim Flaherty, and one of their three triplet sons are saluted while arriving at the state funeral for the former Finance Minister in Toronto on Wednesday, April 16, 2014. The former federal Finance Minister died of a suspected heart attack in Ottawa last week at the age of 64. THE CANADIAN PRESS/Darren Calabrese

  • Prime Minister Stephen Harper looks down as he waits for the start of the state funeral for the late Jim Flaherty in Toronto on Wednesday, April 16, 2014. THE CANADIAN PRESS/Frank Gunn

  • Prime Minister Stephen Harper, left, and his wife Laureen talk as they wait for the start of the state funeral for the late Jim Flaherty in Toronto on Wednesday, April 16, 2014. THE CANADIAN PRESS/Frank Gunn

  • Governor General David Johnston, left to right, shakes hands with Prime Minster Stephen Harper, as Sharon Johnston hugs Laureen Harper at they wait for the start of the state funeral for the late Jim Flaherty in Toronto on Wednesday, April 16, 2014. THE CANADIAN PRESS/Frank Gunn

  • Former prime minister John Turner arrives for the start of the state funeral for the late Jim Flaherty in Toronto on Wednesday, April 16, 2014. THE CANADIAN PRESS/Frank Gunn

  • Former prime minister Brian Mulroney, left, and his daughter Caroline arrive at the state funeral for the late Jim Flaherty in Toronto on Wednesday, April 16, 2014. THE CANADIAN PRESS/Frank Gunn

  • NDP Leader Tom Mulcair, left, and Liberal Leader Justin Trudeau, centre, wait for the start of the state funeral for the late Jim Flaherty in Toronto on Wednesday, April 16, 2014. THE CANADIAN PRESS/Frank Gunn

  • Liberal Leader Justin Trudeau, right, talks to Ontario Finance Minister Charles Sousa as they wait for the start of the state funeral for the late Jim Flaherty in Toronto on Wednesday, April 16, 2014. THE CANADIAN PRESS/Frank Gunn

  • Finance Minister Joe Oliver waits inside the church at the state funeral for the late Jim Flaherty in Toronto on Wednesday, April 16, 2014. THE CANADIAN PRESS/Frank Gunn

  • Ontario Premier Kathleen Wynne, centre, talks to fellow mourners before the start of the state funeral for the late Jim Flaherty in Toronto on Wednesday, April 16, 2014. THE CANADIAN PRESS/Frank Gunn

  • Toronto Mayor Rob Ford and his wife Renata arrive at the church for the state funeral for the late Jim Flaherty in Toronto on Wednesday, April 16, 2014. THE CANADIAN PRESS/Nathan Denette

  • The funeral procession for Jim Flaherty makes its way down the DVP to the state funeral for the late former finance minister in Toronto on Wednesday, April 16, 2014. Flaherty died of a suspected heart attack in Ottawa last week at the age of 64. THE CANADIAN PRESS/Darren Calabrese

  • Ontario MPP Christine Elliott looks over at the casket of her husband, the late former finance minister Jim Flaherty, during visition in Whitby, Ontario on Tuesday April 15, 2014. THE CANADIAN PRESS/Frank Gunn

  • Ontario MPP Christine Elliott (left) wipes a tear as she stands with her sons during the visition for her husband, the late former finance minister Jim Flaherty, in Whitby, Ontario on Tuesday April 15, 2014. THE CANADIAN PRESS/Frank Gunn

  • Ontario MPP Christine Elliott, left, hugs MP Kelly Leitch in front of the casket of her husband, the late former federal finance minister Jim Flaherty, during visitation in Whitby, Ont., on Tuesday, April 15, 2014. THE CANADIAN PRESS/Frank Gunn

  • MP Kellie Lietch blows a kiss to the casket of the late former finance minister Jim Flaherty during visition in Whitby, Ontario on Tuesday April 15, 2014. THE CANADIAN PRESS/Frank Gunn

  • Governor of the Bank of England Mark Carney chats with the family of the late former federal finance minister Jim Flaherty in front of his casket during visitation in Whitby, Ont., on Tuesday, April 15, 2014. THE CANADIAN PRESS/Frank Gunn

  • RCMP officers stand next to Jim Flaherty's casket during visitation at the Abilities Centre in Whitby, Ont., on Tuesday, April 15, 2014. THE CANADIAN PRESS/Frank Gunn

  • A mourner signs a condolence book as he pays respects at the visitation for Jim Flaherty in Whitby, Ont., on Tuesday, April 15, 2014. The former federal finance minister died of a heart attack in Ottawa last week. THE CANADIAN PRESS/Chris Young

  • Mourners queue to pay their respects at the visitation for Jim Flaherty in Whitby, Ont., on Tuesday, April 15, 2014. The former federal finance minister died of a heart attack in Ottawa last week. THE CANADIAN PRESS/Chris Young

  • A lineup of mourners is silhouetted against the setting sun as a video screen plays a slide show of the late Federal Finance Minister Jim Flaherty during visition in Whitby, Ontario on Tuesday April 15, 2014. THE CANADIAN PRESS/Frank Gunn

  • UP NEXT: Flaherty Through The Years

  • Jim Flaherty with his wife(left) after giving his speech at the Provincial Progressive Conservative Party Leadership Convention, held at the Metro Toronto Convention Centre. Mar. 22, 2002 Photo by Louie Palu/The Globe and Mail

  • Jim Flaherty posing with the Stanley Cup while on the campaign trail for the provincial PC leadership at the Hockey Hall of Fame. Feb. 26, 2002 Photo by Louie Palu/The Globe and Mail

  • Ontario Progressive Conservative leadership candidate, Jim Flaherty, on Feb. 27, 2002 Photo by Tibor Kolley / The Globe and Mail

  • At the Ontario Progressive Conservative Leadership debate, Chris Stockwell looks on as Jim Flaherty, left, gets some last minute touch-up to his make-up. Picture taken on Feb.27, 2002. Photo by Tibor Kolley

  • Jim Flaherty becomes new Ontario finance minister, after Ernie Eves resigned from the post. New cabinet members were sworn in today, February 8, 2001, at Queen's Park. Photo by Patti Gower / The Globe and Mail.

  • Jim Flaherty becomes new Ontario finance minister, after Ernie Eves resigned from the post. New cabinet members were sworn in today, February 8, 2001, at Queen's Park. Photo by Patti Gower / The Globe and Mail.

  • Sunday. Mar.18/07. Federal Finance Minister Jim Flaherty will deliver the budget in Ottawa tomorrow.During a pre-budget photo op, he purchased a pair of Canadian-made skates for his son John (16) at Blades Custom Skate Care Inc. in Whitby, Ont. The skates are CCM Reebok 9K pump skates. The total price including all taxes was $456.00. Before the photo op he was scrummed by the media. Pictures taken on Mar.15/ 2007 Photo by Tibor Kolley

  • Canadian Finance minister Jim Flaherty smiles as he takes part in a conference during a meeting of the Group of eight (G8) Finance in Lecce on June 12, 2009. World powers launched a project on the sidelines of G8 talks to develop vaccines against pneumococcal diseases as part of a new market-based mechanism for the developing world. AFP PHOTO / ALBERTO PIZZOLI (Photo credit should read ALBERTO PIZZOLI/AFP/Getty Images)

  • Finance Minister Jim Flaherty tables the federal budget in the House of Commons on Parliament Hill in Ottawa Thursday March 4, 2010. THE CANADIAN PRESS/Adrian Wyld

  • Canadian Finance Minister Jim Flaherty shows a green shoe as he shops in Ottawa on March 28, 2012 for a new pair of shoes as part of the tradition of budget day. The tradition holds that Ministers of Finance purchase or wear new shoes when the budget is delivered. AFP PHOTO/ROGERIO BARBOSA (Photo credit should read ROGERIO BARBOSA/AFP/Getty Images)

  • Canada's Finance Minister Jim Flaherty successfully exits an igloo outside the Nunavut legislature in Iqaluit, Canada during a break in proceedings at the G7 Finance Ministers Meeting, February 6, 2010. Moments earlier Minister Flaherty dislodged a large piece of snow from the entry way of another smaller igloo as he attempted to exit. AFP PHOTO/ GEOFF ROBINS (Photo credit should read GEOFF ROBINS/AFP/Getty Images)

  • Federal Finance Minister Jim Flaherty speaks to reporters at the Port of Montreal, Monday, September 27, 2010. Flaherty insists the government will be "fair and reasonable" in assisting stimulus projects that are supposed to be complete by the end of March. THE CANADIAN PRESS/Ryan Remiorz

  • Hanoi, VIET NAM: Canadian Finance Minister Jim Flaherty (R) meets with his Vietnamese counterpart Vu Van Ninh during a bilateral meeting on the sidelines of the APEC finances ministers' meeting held in Hanoi 07 September 2006. Pacific Rim finance ministers will this week push for renewed talks to free up global trade and pledge steps against terrorist financing, according to a draft of a joint statement. AFP PHOTO/HOANG DINH Nam AFP PHOTO/HOANG DINH Nam (Photo credit should read HOANG DINH NAM/AFP/Getty Images)

  • France's Minister of the Economy, Industry and Employment Christine Lagarde (L), Canada's Minister of Finance, Jim Flaherty (C) and US Treasury Secretary Timothy Geithner attend the final press conference for the G7 Finance Ministers Meeting in Iqaluit, Canada, February 6, 2010. AFP PHOTO/ GEOFF ROBINS (Photo credit should read GEOFF ROBINS/AFP/Getty Images)

  • From left: Canadian Finance Minister Jim Flaherty and British Chancellor of the Exchequer Alistair Darling watch as US President George W. Bush delivers a statement with G7 finance ministers and heads of international financial institutions October 11, 2008 in the Rose Garden of the White House in Washington, DC. AFP PHOTO/Mandel NGAN (Photo credit should read MANDEL NGAN/AFP/Getty Images)

  • Minister of Finance Jim Flaherty poses for a photo following an interview in Ottawa on Monday, Dec. 21, 2009. THE CANADIAN PRESS/Pawel Dwulit

  • Minister of Finance Jim Flaherty and Prime Minister Stephen Harper enter the House of Commons on budget day on Parliament Hill in Ottawa on Tuesday, February 11, 2014. THE CANADIAN PRESS/Patrick Doyle