The party said in a statement that Chacon died on Sunday from a heart condition she had had since birth.
Chacon helped modernize 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 in our party.”
When Zapatero stepped down in 2011, she ran for PSOE’s top leadership, although she eventually lost the vote to former Interior Minister Alfredo Perez Rubalcaba.