The party said in a statement that Chacon died on Sunday from a heart condition she had had since birth.
Chacon helped modernise Spain’s armed forces when she took the helm of the Ministry of Defense in 2008, in the government of Prime Minister Jose Luis Rodriguez Zapatero.
Photos of Chacon reviewing the troops while heavily pregnant became a symbol of a new era in Spanish politics.
Spain’s socialist party, or PSOE, said in a statement that Chacon had always been “at the vanguard” of the party.
“Despite her youth,” the statement said, Chacon had a “passion to defend the socialist ideals and, with time, she became a very important figure.”
Before taking charge of the Defence Ministry, she had previously been minister of housing and a national lawmaker.
When Zapatero stepped down in 2011, she ran for PSOE’s top leadership, although she eventually lost to former Interior Minister Alfredo Perez Rubalcaba. Between 2012 and 2016, she had been in charge of the party’s international relations, before she left politics to join a law firm in Madrid.
Chacon’s body was found by police in her home after relatives called emergency services when they could not reach her. She was married and had a young son.