In its first official comment, the government demanded an investigation and said it was closely watching rumours that the FBI had played a role.
On Wednesday a group committed to ousting North Korean leader Kim Jong-un, the Cheollima Civil Defense, said it carried out the raid.
The group took computers and data and said it gave its evidence to the FBI.
At least two international arrest warrants have been issued for the main suspects.
“A grave terrorist attack occurred on February 22, where an armed group assaulted the DPRK Embassy in Spain,” a spokesman for the North’s foreign ministry said in a statement.
What happened in the raid?
Spanish authorities say one of the group, named as Adrian Hong Chang, gained access by asking to see the commercial attaché, whom he claimed to have met previously to discuss business matters. His accomplices burst in once he was inside.
The group are accused of interrogating the attaché and trying to persuade him to defect. When he refused, they left him tied up in the basement.
Two other members of the break-in group were named as US citizen Sam Ryu, and a South Korean, Woo Ran Lee.
Embassy staff were held hostage for several hours. One woman managed to flee, escaping through a window and screaming for help. Concerned neighbours quickly called the police.
When officers arrived, they were greeted by Adrian Hong Chang, posing as a North Korean diplomat in a jacket with a Kim Jong-un lapel badge.
He told the police that all was well, and nothing had happened.
Most of the group later fled the embassy in three North Korean diplomatic vehicles. Mr Hong Chang and some others left later via the back entrance using another vehicle.
They split up into four groups and headed to Portugal. Mr Hong Chang – a Mexican citizen who lives in the US – allegedly contacted the FBI to give his version of events five days later.
What do we know about this group?
Cheollima Civil Defense (CDC), also known as Free Joseon, is committed to overthrowing North Korea’s ruling Kim dynasty.
A video posted on its website and YouTube page purports to show one of the intruders smashing portraits of North Korea’s communist leaders inside the Madrid embassy.
CDC first came to prominence after taking credit for getting Kim Jong-un’s nephew, Kim Han-sol, safely out of Macau after the assassination of his father.
Kim Jong-nam – who was the North Korean leader’s estranged half-brother – was murdered at an airport in Malaysia in 2017.
Kim Han-sol has expressed his desire to go back to North Korea, and has referred to his uncle as a “dictator”.
What have authorities said about who is behind it?
Sources close to the investigation reportedly told Spanish newspaper El País that the operation was planned perfectly, as if by a “military cell”.
The attackers seemed to know what they were looking for. Spanish authorities suspect US intelligence agencies and their allies could have been involved in the attack, according to El País and El Confidencial.
El País even reports that two of the group have links to the US Central Intelligence Agency (CIA). The CIA declined to comment to the BBC.
The US has denied any involvement in the raid.
Why would anyone attack the embassy?
Reports say the attackers could have been looking for information on North Korea’s former ambassador to Madrid, Kim Hyok-chol, who was expelled from Spain in September 2017 over North Korea’s nuclear testing programme.
Mr Kim is now serving as a key envoy in North Korean talks with the US, and helped organise the summit in Vietnam. He also travelled to Washington DC with Kim Jong-un’s right-hand man, Kim Yong-chol, in January.