The Omar Khadr affair is for the Trudeau government what the census scandal was for the Harper government: a midsummer meltdown that permanently taints the reputation of the prime minister.

There are important differences between the two imbroglios, and we should remember that Stephen Harper's Conservatives won the next election despite the census mess. But, as with that mess, the Khadr affair will leave its mark.

Summer is a dangerous time for governments. Parliament is in recess, the prime minister and senior staff are stealing a bit of vacation. People are relaxing and recharging, getting ready for fall.

Story continues below advertisement

And so the government's guard was down when news broke in the summer of 2010 that the Conservatives had terminated the mandatory long-form census. The story dominated the news for weeks. Municipal and provincial governments, academics, pundits – everyone with an interest in knowing the state of the Canadian population protested that gutting the census was an act of political vandalism.

Read more: Conservatives mount campaign against Trudeau over Omar Khadr settlement

Caught by surprise, and with Mr. Harper deliberately ignoring the news while he vacationed at the government's Harrington Lake retreat, senior advisers struggled to shape a response. People had complained about the intrusive nature of the questions on the long form, industry minister Tony Clement responded. Except virtually no one had complained.

The chief statistician, Munir Sheikh, had assured the government that a voluntary long form would be just as accurate as a mandatory one , Mr. Clement said next. The chief statistician was so incensed by that canard, he quit.

Wounded, angry, refusing to admit it was in the wrong, the government hunkered down. Eventually, the agenda moved on. But people remembered.

Fast forward to this summer. When news broke that the federal government had settled Omar Khadr's lawsuit for $10.5-million and an apology, critics angrily alleged the government had turned a confessed terrorist into a millionaire. Caught off guard, the Liberals kept changing their story. Previous governments had violated Mr. Khadr's Charter rights and this government was simply doing right by him, Justin Trudeau maintained. When that didn't fly, the Prime Minister insisted that the government was saving the taxpayers money by settling for a smaller amount now, instead of a larger amount later. People aren't buying that one, either. Seven in 10 oppose the settlement, according to an Angus Reid poll.

When the census story broke in 2010, the Liberals painted Mr. Harper as a philistine prepared to destroy knowledge for the sake of a blinkered ideology. Similarly, the Conservatives are using the Khadr settlement to paint Mr. Trudeau as not only soft on terrorists, but willing to pander to one. The census charge stuck to Mr. Harper, and the Khadr charge will likely stick to Mr. Trudeau.

Story continues below advertisement

There is, however, one crucial difference between the census scandal and the Khadr affair. In the former case, Stephen Harper was entirely in the wrong. Although he refused to admit it, he cancelled the census to starve the government of data that could be used to justify programs that Conservatives oppose. It truly was an act of political vandalism. But Mr. Trudeau can make a much better case for his actions.

You don't have to believe, as some do, that Omar Khadr was an innocent child who suffered terribly in Guantanamo for a crime he never committed, and whose confession was forced from him in a travesty of justice. You can instead believe that Mr. Khadr is a piece of work. It doesn't matter. The Supreme Court ruled that his Charter rights were violated. He was going to win the lawsuit. The Liberals were simply bowing to the inevitable.

The Conservatives believe that doesn't matter, that the government should have battled to the end and paid what the court ordered grudgingly and without an apology. Reasonable people can disagree on this point. There was no reasonable case for cancelling the census.

Still, the Liberals are going to wear this. There is nothing for Mr. Trudeau to do now but what Mr. Harper did in 2010: hunker down and wait for the agenda to move on.

If Stephen Harper could survive the census, surely Justin Trudeau can survive the Khadr affair.