Plainclothes gardaí swooped on the man after he got out of a taxi on Camden Street, in Dublin’s south inner city, at 9pm on Thursday.
Gardaí arrested the man and searched a holdall he was carrying. Inside they found the firearm and ammunition, including one full and one empty magazine.
The drama unfolded as the busy, pub-filled street was crowded with revellers.
The man arrested is understood to be from Tallaght in west Dublin and is suspected of being a member of the dissident terrorist group, the INLA.
The INLA Dublin unit has become active this year following the release of the unit’s boss from prison.
The man was taken to Harcourt Terrace Garda Station where he was detained under the provisions of Section 30 Offences against the State Act, 1939.
Newly appointed Garda Commissioner Facthna Murphy welcomed the operation and said it was an example of how the force was targeting gun crime.
“I can’t speak much more about it — there’s a person in custody and there may well be a court case to follow,” he said.
“But I can tell you that it is the type of intelligence-led operation I will be asking my people to do — from regional assistant commissioners right down to rank of Garda, the man and woman on the beat.”
In a separate operation, three men were arrested following a large seizure of drugs in Carrickmines, south Dublin, on Thursday night.
A Garda spokesman said officers from Dundrum Garda Station, assisted by Blackrock Drug Unit, searched a house at Glenamuck Road in Carrickmines.
They found 13kg of cocaine, with a final street value of €910,000 and half a kilogramme of heroin, worth €100,000, suggesting a total value of just over €1 million.
One of the men, aged 41, was brought before Dublin District Court and charged. The two other men were released without charge and a file is being prepared for the Director of Public Prosecutions.
In another operation, a man questioned in connection with the seizure of 40,000 ecstasy tablets in Kilcullen, Co Kildare, was released from custody pending a file to the DPP.
The 21-year-old was arrested at Castledermot, Co Kildare, after the Newbridge Drugs Unit made the seizure, which gardaí said had a final street value of €400,000.