LAHORE, Pakistan (Reuters) - The backing of a candidate in a by-election last weekend in Pakistan by a political party controlled by an Islamist with a $10 million U.S. bounty on his head was in line with a plan put forward by the military last year to mainstream militant groups, according to sources familiar with the proposal.

The Milli Muslim League party loyal to Hafiz Saeed - who the United States and India accuse of masterminding the 2008 Mumbai attacks that killed 166 people – won 5 percent of the votes in the contest for the seat vacated when Prime Minister Nawaz Sharif was removed from office by the Supreme Court in July.

But the foray into politics by Saeed’s Islamist charity appears to be following a blueprint that Sharif himself rejected when the military proposed it in 2016, according to three government officials and a retired former general briefed on the discussions.

None of the sources interviewed for this article could say for sure if the MML’s founding was the direct result of the military’s plan, which was not discussed in meetings after Sharif put it on ice last year.

The MML denies its political ambitions were engineered by the military. The official army spokesman did not comment after queries were sent to his office about the mainstreaming plan and what happened to it.

Pakistan’s powerful military has long been accused of fostering militant groups as proxy fighters opposing neighboring arch-enemy India, a charge the army denies.

Three government officials and close Sharif confidants with knowledge of the discussions said the military’s powerful Inter-Services Intelligence agency (ISI) presented proposals for “mainstreaming” some militant groups in a meeting last year. They said that Sharif had opposed the “mainstreaming” plan, which senior military figures and some analysts see as a way of steering ultra-religious groups away from violent jihad.

“We have to separate those elements who are peaceful from the elements who are picking up weapons,” said retired Lieutenant General Amjad Shuaib, adding that such groups should be “helped out to create a political structure” to come into the mainstream.

The plan – which Shuaib told Reuters was shared with him by the then-head of the ISI - said those who were willing “should be encouraged to come into the mainstream politics of the country”.

He added that in his capacity as a retired senior military officer he unofficially spoke to Hafiz Saaed and another alleged militant about the plan, and they were receptive.

Shuaib later said his comments in the interview were taken out of context and were part of a broader discussion about deradicalization strategies. Writing in a local newspaper on Wednesday he said the report “maliciously attributed some statements to me totally out of context, just to suit its own narrative”.

A spokesperson for Reuters said: “We stand by our reporting.”

“PATRIOTIC PEOPLE”

Saeed’s religious charity launched the Milli Muslim League party within two weeks of the court ousting Sharif over corruption allegations.

Yaqoob Sheikh, the Lahore candidate for Milli Muslim League, stood as an independent after the Electoral Commission said the party was not yet legally registered.

But Saeed’s lieutenants, JUD workers and MML officials ran his campaign and portraits of Saeed adorn every poster promoting Sheikh, who came in fourth place on Sunday with Sharif’s wife taking the seat as expected.

Another Islamist designated a terrorist by the United States, Fazlur Rehman Khalil, has told Reuters he too plans to soon form his own party to advocate strict Islamic law.

“God willing, we will come into the mainstream - our country right now needs patriotic people,” Khalil said, vowing to turn Pakistan into a state government by strict Islamic law.

Saeed’s charity and Khalil’s Ansar ul-Umma organization are both seen by the United States as fronts for militant groups the army has been accused of sponsoring. The military denies any policy of encouraging radical groups.

Still, hundreds of MML supporters, waving posters of Saeed and demanding his release from house arrest, chanted “Long live Hafiz Saeed! Long live the Pakistan army!” at political rallies during the run-up to the by-election.

“Anyone who is India’s friend is a traitor, a traitor,” went another campaign slogan, a reference to Sharif’s attempts to improve relations with long-time foe India that was a source of tension with the military.

‘DERADICALIZATION’ PLAN

Both Saeed and Khalil are proponents of a strict interpretation of Islam and have a history of supporting violence - each man was reportedly a signatory to al Qaeda leader Osama bin Laden’s 1998 fatwa declaring war on the United States.

They have since established religious groups that they say are unconnected to violence, though the United States maintains those groups are fronts for funneling money and fighters to militants targeting India.

Analyst Khaled Ahmed, who has researched Saeed’s Jamaat-ud-Dawa charity and its connections to the military, says the new political party is clearly an attempt by the generals to pursue an alternative to dismantling its militant proxies.

“One thing is the army wants these guys to survive,” Ahmed said. “The other thing is that they want to also balance the politicians who are more and more inclined to normalize relations with India.”

The ISI began pushing the political mainstreaming plan in 2016, according to retired general Shuaib, a former director of the army’s military intelligence wing that is separate from the ISI.

He said the proposal was shared with him in writing by the then-ISI chief, adding that he himself had spoken with Khalil as well as Saeed in an unofficial capacity about the plan.

“Fazlur Rehman Khalil was very positive. Hafiz Saeed was very positive,” Shuaib said. “My conversation with them was just to confirm those things which I had been told by the ISI and other people.”

The ISI’s main press liaison did not respond to written requests for comment.

Saeed has been under house arrest since January at his house in the eastern city of Lahore. The United States has offered a $10 million reward for information leading to his conviction over the Mumbai attacks.

Then-Prime Minister Sharif, however, was strongly against the military’s mainstreaming plan, according to Shuaib and the three members of Sharif’s inner circle, including one who was in some of the tense meetings over the issue.

Sharif wanted to completely dismantle groups like JuD.

Disagreement on what to do about anti-India proxy fighters was a major source of rancor with the military, according to one of the close Sharif confidants.

In recent weeks several senior figures from the ruling PML-N party have publicly implied that elements of the military - which has run Pakistan for almost half its modern history and previously ousted Sharif in a 1999 coup - had a hand in the court ouster of Sharif, a charge both the army and the court reject.

A representative of the PML-N, which last month replaced him as prime minister with close ally Shahid Khaqi Abbasi, said the party was “not aware” of any mainstreaming plan being brought to the table.