ISLAMABAD - Pakistani police on Wednesday opened an investigation into the shooting and wounding of a former prominent journalist and head of the state media regulator, who has been a vocal critic of the military and its alleged meddling in politics.

Absar Alam, who is in his 50s, was shot at by an unknown person in a park close to his home in Islamabad on Tuesday, police said in a statement.

He headed the Pakistan Electronic Media Regulatory Authority (PEMRA) for two years under former Prime Minister Nawaz Sharif, who had fallen out with the military before he was sacked by a court on corruption charges, which he denies.

Alam was shot in the ribs and was in hospital but out of danger, police said.

"I have not lost my spirit, and I will not lose my spirit," Alam said in a video message he recorded in a car on his way to hospital after the attack.

Prime Minister Imran Khan's relations with the press and broadcasters have become increasingly strained since he took office after an election in 2018.

Opponents say Khan secured office with the help of a crackdown on the media by the military, which has a history of involvement in Pakistani politics, including staging coups to oust civilian governments.

The military denies meddling in politics or involvement in the shooting.

"We vehemently deny this. The military has nothing to do with this," the military's Inter Services Public Relations (ISPR) wing told Reuters.

Activists say the crackdown on the media since 2018 has left 3,000 journalists and other media workers jobless.

Alam alleged in a tweet over the weekend that the current chief of the military's ISI spy wing called him when he was PEMRA chief to reinstate live coverage by a local TV channel of an Islamist group. The Tehrik-e-Labaik Pakistan (TLP) had choked Islamabad in 2017 protests against cartoons published in France depicting the Prophet Mohammad.

The TLP called an end to violent nationwide anti-France protests on Tuesday after the government called a parliamentary vote on whether to expel the French ambassador over the same issue. 

Amnesty International and the Community to Protect Journalists (CPJ) called on authorities to investigate the shooting and find those responsible.

The shooting "highlights the dangerous climate that all members of the press face in Pakistan if they dare to criticize the country's powerful military", said Steven Butler, CPJ's Asia programme coordinator.

Reporters Without Borders ranked Pakistan among the five deadliest countries for journalists in 2020, when four journalists were killed.

(Reporting by Umar Farooq; Writing and additional reporting by Asif Shahzad; Editing by Nick Macfie) ((Umar.Farooq@thomsonreuters.com;))