Christopher Musa, chief of defence staff (CDS), says it is a treasonable offence for #EndBadGovernance protesters to fly foreign flags in the country.
Musa spoke shortly after a meeting with President Bola Tinubu at the State House in Abuja on Monday.
The trend was first observed in Kano on the first day of the protest.
Protesters waved Russian flags, calling on President Vladimir Putin to intervene in the country.
On Sunday, a faction of protesters arrived in Jos, the Plateau capital, with Russian and Japanese flags, forcing local protest organisers to conclude the march early.
The latest batch of flags were seen on Monday in Kaduna, Kano, and Abuja.
Musa said people caught with the foreign flags will be tried for treason.
A lot of us have seen it where foreign flags have been flown within the sovereignty of Nigeria, and that is totally unacceptable,” the army chief said on Monday after a briefing with President Bola Tinubu.
“We are warning in clear terms, and the president has also said we should convey this: that we will not accept anybody, any individual flying any foreign flag in Nigeria.
“That is a treasonable offense, and it will be viewed and treated as such. So, nobody shall allow himself to be used by any individual.”
In neighbouring Sahelian countries, citizens waved Russian flags and marched on the streets in anti-government protests, triggering a coup.
Musa dismissed the fears, reiterating that security agencies would defend democracy.
“We will not accept anyone pushing or taking any action, seemingly or for whatever reason to want to push for any change of government,” he said.
“Democracy is what we stand for; democracy is what we will continue to defend.
“For those of them flying flags, and if you see, a lot of them are kids being pushed to do that. We’re following up with those ones that are sponsoring them.
Those that are pushing them because, you know, the flies were also made. We have identified those areas, and we are going to take serious action against them.
“The president is clear on his instructions for us not to accept anyone that wants to disrupt the peace and tranquility of Nigeria.
“And we are all standing here together to show Nigerians that we’re working closely; we are working together with synergy to ensure that there’s still peace and tranquility in Nigeria, we have assured Mr. President.”
Much of the protests have been characterised by vandalisation, looting, and deaths.
Musa had warned that the military would step in if the situation escalated.