A gunman who warned his Facebook followers that he was embarking on his “final journey” Thursday has been arrested after allegedly opening fire near protesters demonstrating against India’s new citizenship law, reports say.

Before the attack, the man dressed in a black jacket live-streamed himself approaching the Jamia Millia Islamia University campus in Delhi, where a crowd of more than 1,000 had gathered, according to Reuters.

“He was in front of all the people -- protesters and policemen who were standing nearby, but he jumped in from this side, brandished the gun and said ‘Come I will give you freedom’,” a witness told the news agency.

A man brandishes a gun during a protest against a new citizenship law outside the Jamia Millia Islamia university in New Delhi, India, on Thursday.

The shooting injured one student in the hand. Another witness told the Associated Press that the man fired the shot when police tried to overpower him.

VILLAGERS IN INDIA DRESS UP AS BEARS TO SCARE OFF MORE THAN 2,000 MONKEYS

As he was taken away by police, the shooter told reporters he was named “Ram Bhakt Gopal.” Ram Bhakt means a devotee of the Hindu god Rama.

The law approved by Parliament on Dec. 11 allows Hindus, Christians and other religious minorities from Muslim-majority Bangladesh, Pakistan, and Afghanistan who are in India illegally to become citizens. Leaders of the ruling Hindu nationalist Bharatiya Janata Party say Muslims were excluded because persecution on religious grounds isn't possible in Muslim-majority countries.

But critics have slammed the legislation as a violation of India’s secular constitution, which guarantees equal protection for all, and they have called it the latest effort by the government to marginalize the country’s 200 million Muslims. The government has defended the law as a humanitarian gesture, while dozens of petitions challenging the law are pending with the Supreme Court.

The administration of Prime Minister Narendra Modi has rejected protests against the law and is trying to cast demonstrators as anti-nationals, according to Reuters. Last week, one official from the ruling Bharatiya Janata Party encouraged supporters to chant for traitors to be shot, it added.

CLICK HERE TO GET THE FOX NEWS APP

“Is this what BJP leaders ... intended? Creating an armed militia of radicalized youth,” an opposition party tweeted following the gunfire.

Minutes before Thursday shooting, the gunman reportedly posted pictures on his Facebook profile that he wanted people to “remember his family” as he was taking his “final journey.”

The Associated Press contributed to this report.