Craig Melville, who had to resign his post as a Dundee City Councillor and aide to SNP MP Stewart Hosie over the allegations, is alleged to have sent a series of texts to Nadia El Nakla on the two days following the 2015 Paris terror attacks.
Ms El Nakla, a caseworker for SNP MSP Shona Robison, told a trial at Dundee Sheriff Court how she had started working at the party’s offices in the city in January 2014.
By April of that year she and Melville started an “on off, intimate” affair - despite her being married and he being engaged at that point and marrying later that year.
She told how she was at home on the night of the Paris attacks on Friday 13 November. In the early hours of the Saturday she said she received a drunken phone call from Melville. She said he then sent her a series of texts.
Asked how she felt about the texts, she replied: “I was upset, I was confused and upset. He was very drunk and he wasn’t making any sense. The next day he called and apologised.”
Ms El-Nakla described the pair’s relationship as “friends” at the time the texts were sent.
She said a text he sent criticising one of her friends, Faisal Hussain, telling her he “deserved to be burned alive”.
Another text said: “If I had a gun I’d shoot a Muslim, but I’m not brave enough.”
Ms El-Nakla said Melville had apologised the following day in a text that read: “I’m so sorry for acting like that and saying those things. I’m disgusted with myself, it was wrong, offensive and disgusting and I’ll work on my own head.”
She told the court her husband had taken her phone from her after discovering a text from Melville’s number and had downloaded 14,000 pages of information from her phone, including many deleted texts.
However none of the derogatory texts were found on either her phone or Melville’s mobile telephone by software experts after they were seized by police, the court was told.
Melville, 37, of Marlee Road, Dundee, denies a charge under the Criminal Justice and Licensing (Scotland) Act, which is alleged to have been aggravated by religious prejudice.
The trial continues on 25 January.