The injured Swede, who had been stabbed at her hotel in Figuerola del Camp and taken to a nearby hospital, was treated for cuts on her hands and neck.
She was released from the hospital Saturday and taken to the local police station, according to Spanish authorities.
“The doctor told her that she had been very lucky because she had an injury to her neck that could have been fatal,” a source close to the investigation told local newspaper El Pais.
Her friend was murdered during the attack.
Police arrested a 30-year-old North African man with a resident permit in Spain, confirmed a spokesperson for the Spanish authorities to the TT news agency.
The murder took place between 3:30 and 3:50am at the hotel El Cid, when the suspected killer, also a guest at the hotel, broke into the girls’ room with the intent to rape them, reported the TT.
A fight then broke out.
A series of screams alarmed both the receptionist and a Spanish police officer, who was also vacationing at the hotel.
Both fled to the fifth floor to intervene.
Investigators believe the suspect attempted to rape them, and failing his mission, attacked with a kitchen knife.
The young women, both 18-years-old, were on vacation, celebrating their recent graduation.
They had arrived in the resort area of Malaga three days ago and were staying at the hotel El Cid, located in the heart of town, reported El Pais.
According to the owner of the hotel, the primary suspect arrived at the hotel earlier Friday and met the girls at a discothèque that night. The girls returned to their room at 2:30am, he added.
The surviving victim and the assailant were both treated for cuts sustained during the attack.
The Swedish Foreign Ministry confirmed the information about the deceased.
UD spokesperson, Cecilia Julin, said the victims are both from central Sweden, but not the same cities.
Relatives of the two young women have been informed of the incident.
Investigators are now working to clarify the manner in which the suspect, who remains in custody, entered the womens’ room. Authorities have no information if the man has been previously convicted of violent crimes.
Local police now have 72 hours to formally charge the main suspect.