The migrant is an Algerian in his 30s. He had stowed away in a pipe on the back of a truck waiting to embark at the port, local media reported.
The man was shaken but didn’t require any medical attention beyond first aid at the scene.
The pipe was only 15.7 inches (40 cm) wide Melilla 89.6 FM reported, on its Facebook page.
The dog’s name is Tango. He has sniffed out 1,700 migrants during his eight-year service.
“Ovation to our little Tango,” Spanish police wrote on their Twitter account.