Paul Dewar, the former NDP member of Parliament who represented Ottawa in the House of Commons for nearly a decade, has died.

He was 56 years old.

Dewar was first elected the MP for Ottawa Centre in 2006, and was re-elected in 2008 and 2011. He served as the party’s foreign affairs critic and was a candidate for the NDP leadership in 2011.

Dewar lost his seat in 2015 to Catherine McKenna, when the Liberals retook control of the House of Commons.

Last February, Dewar was diagnosed with grade 4 glioblastoma, a rare type of brain cancer. He underwent surgery and treatment, but revealed in July that the cancer was terminal.

A farewell note from Dewar was posted on his Facebook page Wednesday evening.

"I want to say thank you," the note reads. "My whole life was filled with the kindness of the people of Ottawa, but never did I feel the true depth and generosity of your love more than this past year. You were a constant source of comfort and solidarity for me and my family. I am so grateful for all that you have done.

"I told you that I thought my illness was a gift and I genuinely meant that. In this time in between, I got to see the wonder of the world around us. This reinforced my belief that inherent in our community is a desire to embrace each other with kindness and compassion."

In the last year of his life, Dewar founded and devoted himself to Youth Action Now, a group geared toward supporting grassroots change driven by young people.

“What I have discerned is that notwithstanding the urgency to live as much life as possible, I see this path I am walking as a gift to realize the beauty of life itself,” he wrote in a letter on the group’s website. “Each one of us is capable of contributing something to make a difference with our family, friends and in our community.

“Sometimes cynicism, isolation and fear hold us back from truly contributing and participating in making the world around us a better place.”

Before he entered politics, Dewar was a teacher in Ottawa, with posts at D. Roy Kennedy Public School and Hopewell Avenue Public School.

His late mother Marion Dewar was the mayor of Ottawa from 1978 to 1985.

Dewar is survived by his wife Julia and his two sons, Nathaniel and Jordan.