TRIPOLI (Reuters) - A Libyan navy boat fired warning shots at a search and rescue vessel operated by Medecins Sans Frontieres (MSF) earlier this month because it thought it was involved in smuggling, a spokesman said on Tuesday.

MSF says the Bourbon Argos, which has long been conducting rescue missions for migrants trying to cross from Libya to Europe, was fired on and boarded by unidentified assailants on Aug. 17.

It said some of the shots hit the boat, which was patrolling about 24 nautical miles off the Libyan coast, and that armed men spent about 50 minutes aboard as the crew sheltered in a safe area. There were no migrants on the boat that day, MSF said.

Libyan navy spokesman Ayoub Qassem said the navy patrol boat had taken action after the Bourbon Argos failed to respond to calls and tried to change its route.

"The boat was spotted in international waters and it's known to be an oil smuggling route, so that's why our costal guards had to intercept it," Qassem said. "But the crew tried to flee to the north."

"The guards shot in the air to warn them but because our boat is small and was swaying due to heavy waves there might have been a hit to their boat. I confirm that it was not directly targeted."

MSF said there was no "clear identification and communication or any radio answer" from the Libyan boat and that it had found out 10 days later about the navy's involvement from Libyan media.

"MSF is currently engaging with the Libyan authorities in order to clarify what happened exactly during the incident and to ensure that similar events, that can put people in physical danger,do not occur in the future," the humanitarian group said in a statement issued on Saturday.

Tens of thousands of migrants have crossed the central Mediterranean to Europe this year, most of them leaving from Libya.

Traffickers generally provide flimsy rubber boats, and more than 2,700 have died attempting the journey. In recent days there has been a surge in departures.

Qassem said the incident involving the Bourbon Argos took place off the coast near the western Libyan towns of Sabratha and Zuwara, an area where many boats have left in recent months. Fuel smuggling is also reported to be rife in the area.

Libyan coastguard or naval vessels sometimes stop boats before they reach international waters and return migrants to Libya. The European Union is preparing to train Libyan coastguards in an attempt to help stem the flow crossings.

(Reporting by Ahmed Elumami; Writing by Aidan Lewis; Editing by James Dalgleish)