ISLAMABAD (Reuters) - Pakistan’s army said on Tuesday it will deploy about 371,000 troops to ensure a “fair and free” election on July 25, denying it was rigging the poll to tip the scales in favor of former cricketer Imran Khan.

The run-up to the general election has been marred by accusations that the military is meddling in politics and muzzling the media to help usher Khan’s Pakistan Tehreek-e-Insaf (PTI) into power.

Khan, an anti-corruption crusader and conservative on national security, has denied colluding with the military, which has ruled the nuclear-armed country for almost half its history.

Military spokesman Major General Asif Ghafoor told a news conference that a total of 371,388 troops would be deployed inside and outside polling stations, some three times more than during the last election in 2013.

The election commission had asked the armed forces to help conduct the vote in a “free, fair and transparent manner”, and the army’s role was to assist, he said.

“We need to give them support they have asked for,” Ghafoor said in the garrison city of Rawalpindi, near Islamabad.

The military’s role in politics has again come into question since the Supreme Court ousted Prime Minister Nawaz Sharif in 2017 for failing to report a monthly income of 10,000 Emirati dirhams ($2,723) from a company owned by his son.

He denied drawing the monthly salary and has denounced his ouster as politically motivated, often suggesting the military was to blame.

The military denies involvement in civilian politics but ended Sharif’s second stint in power in 1999 in a bloodless coup.

The July election is likely to come down to a contest between Sharif’s Pakistan Muslim League Nawaz (PML-N) and Khan and his PTI party.

Ghafoor dismissed suspicions that the military was favoring Khan.

“We don’t have a political party. We don’t have a loyalty,” he said.

Ghafoor also dismissed any suggestion the military was forcing Sharif’s supports to switch parties.

Sharif, who was last week sentenced to 10 years in prison on charges linked to corruption, has alleged the military and its security agency has been pressing his party’s candidates to switch loyalties.

Sharif, who is in London caring for his wife who is there for medical treatment, fell out with the military when he returned as prime minister for a third time in 2013, partly because he challenged the military over foreign policy, which the generals traditionally consider their domain.