Berbera, Somaliland (CNN) -- When you read about anti-piracy efforts off the coastline of Somalia, you imagine huge war-ships slicing through the waters, with terrified sea bandits scattering in their wake.

But closer to shore, in the tiny breakaway east African state of Somaliland, it's a different picture. Despite being only a few hundred kilometers down the coast from piracy-ridden Puntland, Somaliland's coast guard operates with more than modest resources.

A 20-foot long motor boat in Berbera, the country's port town, lies at the docks, seemingly broken beyond repair. One other coast guard boat - which I am assured is sea-worthy -- is brought out. Soldiers pile on board carrying RPG rockets and AK47s.

"As you know, we have only two boats and they are very small boats," explains Issa Mahad Abdi, second-in-command of the coast guard. "The coast is very long and we cannot cover it all but we try our best."

Their performance in the water, however, seems to prove that they are more than a rag-tag group of officers. One fishing boat far beyond the breakwater cannot be identified and the coastguard race toward it. After leaping on board and searching the tiny vessel, there is much hand-shaking and everyone is on their way.

"That boat came in from the east and nobody knew if they were pirates or local fishermen," Mahad Abdi shouts over the engine as we roared away. "Therefore we attacked it and we found that the boat was a Somaliland fishing boat. So always we go patrolling in this area and when the radar tells us, we attack."

But if their target is clearly armed then it's a much less friendly affair, he explains.

"When we meet the pirates, several rounds we fire over them. And they are afraid - they only have small boats, very small boats - so they give up. They put their hands up and we catch them, collect their arms, tie their boats and come here."

Life inside Somaliland's pirate prison

A group of pirates being chased by Mahad Abdi and his colleagues recently came ashore and fled through the coastal plains and into the mountains. The coast guard chased the fugitives deep inland on vehicles and caught them as they got lost.

"They don't know the land so it was a stupid place for them to run to," Mahad Abdi recalls, smiling.

The success of the coast guard is hardly surprising, considering the career paths of their leaders. Mahad Abdi and his senior colleagues were all members of Somalia's formerly strong navy, based in large southern ports such as Mogadishu and Kismayo. There they served under notorious dictator Siad Barre.

Mahad Abdi tells me he trained in the United States with the Marines. His boss, who he says is now too old to be out on raids, was taught in the Soviet Union, a testament to the Cold War that was then creeping deep into Africa.

"It was tough training in Texas and Virginia," says Mahad Abdi. "A lot of the men were younger than me and physically it was really tough, but I passed anyway."

Since then, these seamen have witnessed the collapse of government in Somalia in 1991, the destruction of the navy and Somaliland break away as an independent state from the chaos in the south. The phenomenon of piracy, however, has given them a new, crucial mission which they are embracing whole-heartedly. So much so that Somaliland's jails now have dozens of pirates languishing in their cells. That one small coastguard boat we patrolled on, Mahad Abdi tells me, has caught close to 100 pirates during the past couple of years.

But the coast guard can't patrol constantly. The state - which has not been recognized internationally as a country yet - is deeply impoverished. The coast guard sleep on the floor of their dilapidated headquarters. I had to insist on paying for the fuel costs of our trip out to sea.

But they have one secret weapon: local people. Berbera Port is the only economic option for the town, and Somalilanders know piracy on their shores spells disaster.

On the docks, one small employment office attracts a huge crowd of men every morning, shouting and pushing to the front, in hope of the only paid work in town that day. This, as well as a history of conflict and opposition to neighboring Puntland -- where most of the pirates are based - means that local people call the coast guard when they spot suspected pirates.

"If they are fishermen, rural area people, if they are businessmen, they have a general concept to fight piracy," says Ahmed Yussuf, Berbera's port manager, sat in his office overlooking the ocean.

Without local cooperation, Mahad Abdi explains, this strategy wouldn't work. "If we get more boats, we can go wherever the pirates are and we can save the merchant ships," he adds.

Limited international aid has been forthcoming, Mahad Abdi says, including 4 x 4 vehicles from the British government, which are used to drive around the port when the weather is very hot. As the piracy problem spirals, so there has been international interest in spending money on private navies. But at the same time many shipping companies have also paid ransoms to pirates to free their vessels.

"The money these companies are paid should go to the coast guards," says Ismail Aar, Somaliland's justice minister. "They should be given radars, they should be given communications. We need a communication center to be established here so that we can communicate with Yemen and Djibouti, so we can share information and experiences."

Aar argues that ransom payments only compound the problem, encourage piracy in Puntland and undermine the rule of law in the region.

He calls for the international community to support the democratic process that is going on in regions like Somaliland, which has seen democratic elections. Piracy cannot be solved at sea, says Aar, and only the rule of law on land can stamp out the problem.

But despite the security and political progress in Somaliland, the coast guard need more funds, equipment and training. Berbera does have a tiny university specializing in marine studies - but it has no means of teaching potential coast guards. Mahad Abdi and his most-experienced colleagues are now old men. They are due to retire and the future of their country's coastal waters causes concern. They worry that without them, the pirates could run amok.