North Korea's nuclear and ballistic missile programmes "create a serious threat to peace in the region and to global security," the foreign ministry said in a statement.
"The embassy of the DPRK had been warned by the foreign ministry that the continuation of these actions would have consequences on bilateral relations," it added.
"Today the DPRK ambassador has been summoned and the position of the Spanish government has been reiterated and he was informed of the decision to reduce the number of diplomatic staff at his representation in Madrid."
The North Korean embassy, which opened in 2014, is staffed by an ambassador and two diplomats, a foreign ministry spokeswoman told AFP.
"One of the two diplomats will have to leave by September 30th," she said. North Korea -- the Democratic People's Republic of Korea (DPRK) -- has repeatedly conducted missile launches in recent months, despite being barred from doing so under United Nations rules.
The country fired a ballistic missile over Japan on Tuesday in a major escalation that triggered global alarm and a furious response from Tokyo.