The incident occurred as a lifeboat containing 70 people rescued from the high sea was coming in to dock at the town, where Spain opened a new migrant reception centre this summer to register people who attempt the perilous journey across the sea to Andalusia each week.
As the boat was beginning its approach, officers saw four people jump overboard, in an effort to swim to a jetty opposite the docks.
Officers enlisted the assistance of a small fishing boat to quickly locate them, the Policia Nacional said, and while three made it to the shore, one was visibly struggling, screaming for help and starting to submerge.
In response one officer "jumped into the water and swam around 100 metres to reach the location, noting that the person was rigid and immobile due to exhaustion and fatigue".
"After turning him into the safety position, he (the officer) began to move him to the shore until a fishing boat reached them and managed to get him on board. The man was subsequently taken to get medical assistance where he was treated for breathing problems," the statement on the Policia Nacional website concluded.
Following a crackdown by Libyan authorities and Italy’s hardline approach to migrants, Spain has this year become the main destination for those trying to escape Africa for Europe.
Thousands have arrived in the country by sea in 2018 and hundreds have died while trying to do so.
Last week Spanish PM Pedro Sanchez said that Spain and Germany are in discussions with the European Commission in an effort to help Morocco improve its effectiveness in controlling its borders. The North African country is a major point of departure for people trying to enter Europe.
"Fourteen kilometres separate the coast of Spain – and therefore Europe – from those of North Africa but there is an infinitely greater distance in terms of development. Reducing the depth of this abyss of inequality must be one of the main tasks of the European Union," Sanchez said following talks with German Chancellor Angela Merkel.