A suspected Hindu nationalist went live on Facebook to warn he was taking his “final journey”, minutes before opening fire on university students protesting against India’s new citizenship law.

One student was reportedly shot in the hand before police arrested the alleged gunman, who timed his attack on Thursday to coincide with the anniversary of the assassination of Mahatma Gandhi in 1948 by a Hindu radical.

Video circulating on social media showed the man brandishing a handgun, metres away from dozens of police officers outside Jamia Millia Islamia university in Delhi, where more than 1,000 protesters had gathered for a march.

“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,’” one witness told Reuters.

Q&A What is India's controversial citizenship law? Show The new citizenship law provides a path to citizenship for religious minorities who have immigrated into India from Pakistan, Bangladesh and Afghanistan before 31 December 2014. It explicitly lists Hindus, Sikhs, Buddhists, Jains, Parsis and Christians as being able to take advantage of the new provisions, excluding Muslims. Besides stoking concern among Muslims, the proposed changes have also led to protests by residents unhappy about an influx of Hindus from Bangladesh, who stand to gain citizenship.

The highly charged word azadi (freedom) was previously associated with Kashmiri separatists, but has been used widely during the previous month of protests against the citizenship law.

The law makes it easier for persecuted religious minorities from three neighbouring countries to get Indian citizenship, but not if they are Muslim. Critics say this forms part of a master plan by the prime minister, Narendra Modi, to remould India as a purely Hindu nation, marginalising its 200 million Muslims. Modi denies this.

The man told reporters he was named “Ram Bhakt Gopal” as he was taken away by police. Ram Bhakt means a devotee of the Hindu god Rama.

The alleged gunman went live on Facebook before Thursday’s incident as he walked around the protest area.

“On my last journey, take me draped in saffron and shout slogans of Hail Lord Ram,” one post on his page read – a popular chant for Hindu nationalists. Saffron is a colour associated with Hinduism – and with Modi’s Hindu nationalist Bharatiya Janata party.

Facebook later said it had taken down the gunman’s account. “There is no place on Facebook for those who commit this kind of violence,” the platform said in a statement.

“We have removed the gunman’s Facebook account and are removing any content that praises, supports or represents the gunman or the shooting as soon as we identify it.”

The main opposition Congress party said the shooting showed that comments by leaders of the ruling Bharatiya Janata party could stoke violence. “Is this what BJP leaders ... intended? Creating an armed militia of radicalised youth,” the party said in a tweet.

India’s home minister, Amit Shah, tweeted that he had spoken to the chief of Delhi police and asked him to take strict action. “The federal government will not tolerate any such incident, will take serious action and the perpetrator will not be spared,” he said.