The man was detained by the police at around 5 p.m.local time after security guards at the entrance of the world famous church discovered the ammunition as the man passed his bag through a scanner.
The man identified himself as a member of the French military and the Mossos accompanied him to his nearby vehicle. Inside the vehicle they discovered a firearm which had its serial number removed.
According to reports, the detainee told the Mossos d'Esquadra it was a misunderstanding and that he had forgotten he was carrying the ammunition in his bag.
He has been taken to the Les Corts police station in Barcelona while authorities attempt to confirm his story with French intelligence services.
Spain is currently on a level 4 (high) alert for a possible terrorist attack, with special security measures all over the country ahead of New Year celebrations on Monday night.