The two men were rescued in the Strait of Gibraltar, where a helicopter picked up one man clinging from a half-sunken rubber dinghy and another helicopter recovered the second man as he swam nearby.
The men were thought to have been on a boat attempting to cross over to Spain from Morocco in rough waters, a spokeswoman said.
“One of the men who was rescued said there were originally six men aboard the boat, so possibly one is missing,” she said, adding that the search was continuing for the sixth man.
At least 3,000 migrants and refugees have died crossing the Mediterranean so far this year.