A suspected Hindu nationalist opened fire at an anti-government protest in India's capital on Saturday, police said, just days after an armed teenager shot and injured a student at a rally in the same city.

The gunman fired into a large crowd of female demonstrators at a non-stop protest in New Delhi against Prime Minister Narendra Modi's contentious citizenship law that critics say discriminates against Muslims. No injuries were reported.

Footage broadcast on local television stations showed a man in his 20s being taken away by police as he shouted that “only Hindus will prevail in the country.”

Officers said the attacker fired at least two rounds towards protesters and tried to escape after his weapon froze, but was caught by locals.

“We have taken him into custody and recovered the weapon,” a police official told AFP.

The incident occurred in the New Delhi suburb of Shaheen Bagh, which has become the epicentre of protests against Modi's government since mid-December when parliament passed the law that grants citizenship to only non-Muslim nationals from Pakistan, Afghanistan and Bangladesh.

Critics say this creates a religious test for nationality in a secular country and along with a mooted national registry will marginalise its 200 million minority community — claims that Modi denies A 17-year-old man opened fire on a protest rally against the law on Thursday, hitting a student in the hand.

Videos showed him brandishing a pistol and confronting protesters while shouting “Hail Lord Ram” and “Yeh lo azadi” ( “Here is your freedom “) — a slogan popular with anti-government protesters — before firing a single shot at the marchers.

The back-to-back incidents come after a minister in Modi's government, Anurag Thakur, called on crowds at a rally to “shoot the traitors” earlier this week.

Several members of Modi's Hindu nationalist Bharatiya Janata Party have termed the protesters “anti-national” and “traitors”.