The 50-year-old man allegedly attacked the woman while she was sleeping, Civil Guard officers said.
He is thought to have bludgeoned the victim with a blunt object before fleeing the scene believing his ex-partner to be dead, Spanish news agency Europa Press reported on Wednesday.
But the injured woman was discovered by her son and rushed to Hospital Costa del Sol with serious injuries.
A search of the office in Benalmádena where the aggressor worked revealed a note outlining the man's plans to murder his ex-partner, sources close to the investigation told Diario Sur.
The man's Volkswagen car was found near the Jaén town of Santa Elena.
The man's body was then found at the bottom of viaduct, according to Spanish media reports.