The Liberal Democrat MEP who yesterday defected to the Tories had previously accused Conservative leader David Cameron of building an alliance with homophobic politicians in the European Parliament.

Sajjad Karim claimed yesterday that Cameron’s “incredibly impressive” speech recent speech about immigration had persuaded him to leave the Lib Dems.

However, just a few weeks ago he had attacked his new leader for being a political “chameleon,” the Times has reported.

Mr Karim, who was Britain’s first ever Muslim MEP when elected to represent North West England in 2004, revealed his feelings about Mr Cameron through postings on his blog, sajjadkarimmep.blogspot.com, earlier this year.

On June 9 he wrote on the site: “With their failure to support a resolution condemning discriminatory remarks by political and religious leaders targeting homosexuals, the Tories have shown their true colours.

“Tory apathy in the face of rising homophobia should come as no surprise as, today, the Conservative camp is rife with contradiction.

“Whilst Cameron attempts to paint a glossy image of a gay-friendly party in the UK, he is also desperately trying to get into bed, at European level, with Poland’s openly homophobic ‘Law and Justice’ party.

“I just hope the British public see Chameleon Cameron for who he really is!”

A spokeswoman for Mr Karim told The Times that some postings had been placed on his blog by an employee without Mr Karim’s knowledge, and the employee had subsequently been disciplined.

However, she was unable to explain why, despite the disciplinary action, the postings were still in place almost six months later.

Mr Karim has said in a number of interviews that Cameron’s stance on immigration persuaded him to defect to the Conservative party.

He said: “David Cameron’s recent speech on immigration was incredibly impressive, sensible, rational and positive. It persuaded me that he is a leader who has changed his party and will change this country.”

Mr Karim’s decision to join the Tories has left Lib Dems furious.

Yesterday a party spokesperson said Mr Karim had only quit after the party decided not to select him as its top candidate for the North West for the European Parliament.

In a ballot of party members, Mr Karim was elected to second place last week, behind Chris Davies, in the European Parliament regional list system.

Mr Karim has now launched an attack on the Lib Dems, describing the party as directionless in a radio interview yesterday.

“I have served within (the Lib Dems) loyally for some 18 years, and now I am at a stage where clearly I feel that they have lost their way.

“They just don’t seem to be serious about their politics,” he said on BBC Radio 4’s Today programme.

As a result of Mr Karim’s defection the Lib Dems have 11 MEPs and the Tories have 28.