OTTAWA — Prime Minister Stephen Harper’s former top foreign policy adviser has published a scathing critique of the Conservative government’s handling of relations with China.

David Mulroney, Canada’s ambassador to China from 2009 to 2012, says Canada should boost its economic and diplomatic ties with China and even reinforce its naval presence off the west coast to show its serious about being a player in the region.

But Harper has failed to show adequate leadership and has been wildly inconsistent, with periods of estrangement and hostility followed by flurries of activity to try to woo Beijing, according to the ex-diplomat.

Government policy is too often directed by political partisans with “extreme ideological” agendas, who are motivated only by the goal of winning votes in immigrant communities in Canada.

“We need leadership from the top,” writes Mulroney, who was named Harper’s senior foreign and defence policy adviser when the Conservatives took power in 2006.

His book Middle Power, Middle Kingdom, to be published later this month by Penguin Canada, is likely to be controversial. His concern about Chinese money boosting housing costs in cities like Vancouver, reported in Tuesday’s Vancouver Sun, led to number of readers to contact The Sun sharing those concerns.

Mulroney, now at the University of Toronto’s Munk School of Global Affairs, is particularly critical of Canadian prime ministers — and especially Harper — who have used foreign policy to win favour with diaspora groups within Canada.

He said political leaders in countries such as India and China are decidedly unimpressed when a prime minister shows up with Canadian MPs returning to their, or their ancestors’, country of origin.

He said Harper is treating foreign leaders as “mere props” participating in “photo opportunities” aimed at ethnic media back in Canada.

“It would be naive and undemocratic to argue that domestic politics has no place in our foreign policy,” he writes. “But political leaders need to rely on something more than the most recent polling data in navigating international issues.”

Mulroney also challenges the Harper government’s “increasing preference” for rhetoric — “the more extreme the better” — over behind-the-scenes diplomacy.

“The resulting ‘megaphone diplomacy’ is gratifying to some audiences at home, but it erodes and undercuts whatever real influence Canada might have had.”

Mulroney is particularly scornful of Canada’s standoffishness in the face of China’s growing economic and military clout and its aggressive stance with its immediate neighbours, which has raised concerns about a potential conflict involving the U.S.

Canada should be joining like-minded democracies in engaging with China, participating in military and cultural exchanges, using an expanded naval presence to take part in anti-terrorism and anti-piracy initiatives, and being open to Beijing’s offers to expand economic ties.

But he said Canada’s erratic approach — Harper was initially cool to China after taking power, then tried to make amends after a visit to Beijing in 2009, but then backed off again after China in 2012 offered to open free trade talks — means Canada is not taken seriously by its allies in the region.

He cited Canada’s difficult though ultimately successful bid to be included in the U.S.-led Trans-Pacific Partnership trade talks, and Canada’s absence from several regional multilateral bodies.