The man, whose identity and age were not revealed, had "served a sentence for the murder of French railway worker Jean-Pierre Leiba... in 1984 as part of the GAL armed group," the ministry said in a statement, adding he was "considered very dangerous."
Leiba was killed by mistake in Hendaye in southwestern France while he was with three Basques.
The attack was committed by the GAL - secret armed squads set up to fight ETA, which long campaigned for independence for the Basque Country. The GAL - meaning Anti-Terrorist Liberation Groups - was accused of 28 killings between 1983 and 1987, most of them in the French Basque region.
The alleged jihadist was arrested on Tuesday in Segovia, some 80 kilometres (50 miles) northwest of Madrid.
According to the ministry, he was born in Irun on the border with France, and had adopted ideas revolving around "religious extremism of a jihadist nature and was disseminating propaganda for Daesh," an Arabic term for IS, also known by the acronyms of ISIS or ISIL.
He was "determined to commit a terrorist attack," it added.
The suspect had been under police surveillance, the ministry said, having travelled "to war zones in Afghanistan, Syria and Palestine where he expressed willingness to commit suicide attacks if he had the opportunity."
According to Spanish authorities, 173 alleged jihadists have been detained since 2015, when Spain increased its terror alert to four out of five.
But unlike nearby France or Belgium, the country is less exposed to the return of nationals who went to fight abroad and plan to commit extremist acts on home soil.
Only around 200 Spaniards are estimated to have gone abroad to fight, compared to thousands from France and Belgium.