A third man was detained by Algerian authorities, Moroccan media claimed.
The border has long been closed because of deep tensions between the two North African neighbours, linked to the disputed territory of Western Sahara among other issues.
Deadly run-ins on the maritime border are rare.
A French citizen was among those killed in the stand-off which reportedly happened on Tuesday, and the detained man is also French, the French foreign ministry said.
Moroccan media reports said the men involved were French-Moroccan dual citizens.
The Paris prosecutor’s office has been informed about the incident, the French ministry said, adding that it is up to judicial authorities to determine what happened.
The French government is in contact with the families of the French citizens as well as with Moroccan and Algerian authorities, it said.
Mohamed Kissi told Moroccan news website 360.ma that his brother was killed in the incident.
He told how he, his brother Bilal and two friends were on holiday and riding personal watercraft off the coast of the Moroccan town of Saaidia when night began to fall.
“We were low on fuel for the water scooters and were drifting. In the darkness, we found ourselves in Algerian waters,” he told 360.ma.
He said a speedboat carrying armed forces with the word “Algeria“ on its side approached the water scooter his brother was riding and words were exchanged.
Mr Kissi said the Algerian forces then fired on the group, and his brother was killed along with their friend Abdelali Mechouer, according to 360.ma.
Their other friend was wounded and detained by Algerian forces, Mr Kissi said. He said he swam to escape and was rescued by Moroccan maritime police.
The website published a video of the funeral for Bilal Kissi on Thursday in the Moroccan border town of Bni Drar. It said Mr Mechouer’s family is seeking the repatriation of his body, which was recovered by Algerian forces.
Asked on Thursday about the confrontation, Moroccan government spokesperson Mustapha Baitas said that “these issues are within the jurisdiction of the judicial authority”.