A Conservative MP and his two aides spent more than double the legal limit in election expenses as they fought off a challenge from Ukip’s Nigel Farage in the 2015 general election, a court was told on Tuesday.

The South Thanet MP, Craig Mackinlay, along with a campaign organiser from Conservative Central Office and his agent, are alleged to have failed to declare up to £66,600. The court heard they then knowingly filed “woefully inaccurate” expenditure returns that included a forged signature.

Declared spending on the campaign came in under the strict £52,000 limit, but prosecutors allege up to £66,600 more was spent on staffing, accommodation, advertising, posters and a bus for Mackinlay’s campaign but was not declared.

Mackinlay, 51, faces two charges of making a false election expenses declaration during the campaign which ended with him winning with a majority of almost 3,000. Marion Little, 62, a party activist employed by Conservative Central Office, is charged with three counts of aiding and abetting Mackinlay. Nathan Gray, 28, is accused of two offences of making a false declaration.

Aftab Jafferjee QC, opening for the prosecution at Southwark crown court in London, said Little had been sent to the constituency from Conservative headquarters to take control of Mackinlay’s campaign because Farage, the then Ukip leader, was seen as a threat.

“In those pre-referendum days, Ukip were on the rise and the threat perceived by the Conservative party to their share of the vote only intensified in the lead-up to the 2015 election,” he said. “When Nigel Farage announced that he would step down as leader of Ukip if he failed to win the South Thanet seat, it was clear that this was not going to be any ordinary election campaign.”

The charges relate to party spending during the 2015 election campaign and before the 11 June statutory time limit on prosecutions.

Little effectively took over the campaign in March 2014, several weeks before the election, and was joined by other Tory activists who stayed in hotel accommodation, the prosecution alleged. This generated thousands of pounds in election expenses that had not been declared in official returns, it was claimed.

“This was a fixed-term election. As a result, there was a well-recognised election expenses system to be followed,” Jafferjee said.

Those activists included Nick Timothy, who was then a close aide to the then home secretary Theresa May and subsequently became Downing Street’s chief of staff, the court heard.

The prosecution alleged that costs for accommodation, travel, posters, leaflets, advertising and salary costs of Tory staffwere omitted from returns,

that were knowingly submitted with false declarations. All three defendants had signed the returns and played a part in the submissions.

The long campaign declaration – which covered election expenses for 100 days from December 2014 – said the party spent about £32,661 – about £4,500 below the spending limit. The short campaign declaration – covering the last few weeks running up to the general election- claimed £14,875 was spent, a little below the limit.

“It is the prosecution’s case that neither of these declarations were true. The returns were woefully incomplete and woefully inaccurate,” Jafferjee said.

Jurors were told up to £14,600 in costs were undeclared in the long return and up to £52,000 had not been accounted for in the short return. It is alleged that some expenses incurred during the campaign were wrongly attributed to national Tory expenditure. If they had been attributed correctly, they would have been in breach of spending limits, it was claimed.

The court heard Little booked into Royal Harbour hotel in Ramsgate, in the constituency, on 23 March 2015 and stayed until the end of the campaign on 7 May. In an email, Little said she had been “marooned in South Thanet”.

The trial heard that, after the Conservative victory, Gray emailed Little congratulating her on a “truly magnificent election campaign”.

Jafferjee said Mackinlay and Gray knowingly allowed Little to dictate what was declared on the returns, which did not include her costs.

The court was told that when Little was first questioned by police, she said she was not working for Mackinlay but carrying out national campaign work and was only occasionally helping Mackinlay in her “spare time”.

Jafferjee said she now says she came to Kent to stop Ukip and the benefit to Mackinlay was “collateral”. “Such an explanation is factually and logically incoherent. How can you defeat Nigel Farage unless Craig Mackinlay was elected?” he asked.

In last year’s general election, a week after it was announced that he would be prosecuted, Mackinlay held on to South Thanet with an increased majority of 6,387.

The three defendants deny all the charges. The trial continues.