Image caption Neale Hanvey was elected in December's general election despite being suspended by the SNP midway through the campaign

An MP who was suspended from the SNP during the election campaign for using anti-Semitic language on social media is to be readmitted to the party.

Neale Hanvey was elected MP for Kirkcaldy and Cowdenbeath despite being suspended from the SNP on polling day.

He had apologised "unreservedly" for making posts on social media which he said were "clearly unacceptable".

Mr Hanvey will rejoin the SNP group in May on the condition he completes an education course at a Holocaust centre.

The decision of the party's member conduct committee is open to appeal.

Mr Hanvey told BBC Scotland that he had been "tortured" by his suspension and had experienced an "internal moral panic" because he does not consider himself to hold racist views about Jewish people.

He said he had never intended to cause offence and was "earnestly trying to make amends" by working with the Antisemitism Policy Trust to better understand the issue.

The MP said he could not discuss the disciplinary process because he had given the SNP a commitment to "maintain confidentiality".

The Scottish Council of Jewish Communities said education and engagement were "absolutely vital".

Mr Hanvey has been sitting as an independent MP since December's snap election, when he unseated Labour's shadow Scottish secretary despite SNP members being urged not to campaign for him.

He was suspended from the party midway through the campaign after admitting making "deeply offensive" posts online, but it was too late for him to be replaced on the ballot paper.

He had shared a post on Facebook in 2016 which included an image of billionaire George Soros as a puppet master controlling world leaders, and made another post which drew parallels between the treatment of Palestinians and the "unconscionable treatment" of Jews in World War Two.

The former councillor issued an "unequivocal" apology, saying he wanted to "seek to make amends for these dreadful errors of judgement with the Jewish community".

The SNP's member conduct committee has now decided that Mr Hanvey should be allowed back into the party after a six-month suspension, back-dated to when he was first suspended in November.

This should see him rejoin the party's MPs in the Commons in late May - on the condition he completes an education course at a Holocaust centre, meets with Scotland's Jewish community, and apologises.

The party said there was no place for anti-Semitism in the SNP or in wider society.

In a statement, the Scottish Council of Jewish Communities said the party had "demonstrated that it is able to engage with the Jewish community on these issues, and has committed to a disciplinary action".

It added: "This goes beyond imposing penalties. Education is absolutely vital. Although Mr Hanvey has apologised, meaningful engagement and education are crucial to demonstrating that he understands the seriousness of his actions and the impact that anti-Jewish racism has on real people."