The bather got into trouble while attempting to chase a swan float that had been carried away by the wind, Marco Bencivenga, a newspaper director holidaying on the Italian island, told CNN.
The man's friends saw that he needed help and began shouting and waving to get the attention of lifeguards, who rushed to deploy a rescue boat.
But Magnini, who was bathing nearby, was closer and quickly reached the struggling swimmer, keeping his head above the water until lifeguards arrived, said Bencivenga.
Magnini, who retired from professional swimming in 2017, is an Olympic bronze medalist, and won 100 meter freestyle golds at the 2005 and 2007 world championships.
Magnini told Bencivenga that the bather had been in great difficulty -- scared, swallowing seawater and unable to speak.
The swimmer said it wasn't easy to lift the man onto the raft so he helped him onto a double airbed that other bathers had nearby.