Iused to carry a Beretta 22," says Jamie Coutts, as our jeep rumbles along the rocky road.

"This place used to be pretty wild." Choosing the right gun for protection isn't the usual concern of a Scots farmer, but it was a necessity for Coutts who set up his finca (farm) in El Salvador following the bloody civil war.

He first visited in 1990 as a human rights activist. "I wanted to understand how people could line 15 men against a wall and cut them down with a machine gun," he explains. "I was also passionate about the idea that everyone has a right to life, to work, to education. That flame still burns."

Months of volunteering at refugee camps turned into years living in the country, working with United Communities of Usulutan (Comus), a cooperative of coffee farmers. For the last 22 years, since the signing of the Peace Accords in 1992, he's made his home in the town of San Francisco in Usulutan. For a while, he only grew coffee. Then came pigs, cows and sheep, which in El Salvador, where sheep farming is almost unheard of, makes him an oddity. "Aye, they just say 'There goes the Scottish guy. I'm just the crazy Scot, you know?"

Coutts, 45, was born in Glasgow and lived in Lenzie and Bearsden, then Drymen, where his father, Alan, still lives. His mother Dorothy died last year, aged 83.

"My mother was a teacher for 32 years and she said if you can help somebody, you do it. And it's free - no strings attached. That was the way I was brought up."

Coutts didn't do well at school. "I was more interested in what was happening outside." He trained as a greenkeeper and attended horticultural college. He also spent four years working with Amnesty International during which time he read reports of massacres and human rights abuses in El Salvador's war between government forces and left-wing guerrillas.

Following the Peace Accords, as people started to rebuild lives, his knowledge of agriculture came in handy. But it took a while to win people over. "Just being a bit whiter than most, you're an outsider. Not being born in the village, you're an outsider. But a lot of people came to workshops, took ideas and put them into practice."

Usulutan was a lawless place, with shell-shocked soldiers and lots of guns. "After demobilisation, there was no real gun control," he says. "If you wanted an AK-47, you could buy one for $50. When I came to live on the plantation, people were worried that people would try to do something to me. One night, they put stones on the road as a roadblock so I was forced to stop. I was in a perfect ambush situation. I could hear people around me. I didn't know if they had machetes or guns so I pulled out my handgun and fired off six shots, put in a new magazine and I could hear people scampering away. There was no police force for five or 10 years. It was you or them."

I walk around San Francisco with Coutts, where Comus's offices are based. He's a big part of the community, generous with his time, well liked. "When a refugee says to you, 'What you learned at agricultural college can help us change our lives, please help us,' that's like realising that what you've been taught is a gift," he says.

In 2001, he married a Salvadoran, Cleotilde. But their marriage is unusual, he says. They've spent many years apart, both married to their causes. She has worked in disaster relief in Haiti and Guatemala, while he splits his time between the Salvadoran capital San Salvador and Usulutan.

No longer an outsider, he's committed to the country. "After 15 years working with Comus 24/7, if someone calls me and says there's a problem, you're there, no question. I remember after the earthquake in 2001, we worked solidly for six days, walking around like zombies. I'm not interested in money. If that was what motivated me, I could go back to the UK. I like to help people."

I stay overnight at Coutts's finca. In the morning, the sheep are led out to the hills. Jamie's dogs laze in the yard. The farm produces around 4200 pounds of coffee each year. His sheep are a tropical breed called Pelibuey. "Being a Scot, I like a bit of lamb. I thought why not?" he says. "I'd tried cows too, but they were stolen. They don't steal sheep because there's not a culture of eating the meat. Mostly people ask me what it tastes like. They're very curious."

We walk around the hills where his sheep are grazing. Coutts shows me the coffee-processing plant he set up for Comus, a project completed with funds from Scottish Catholic International Aid Fund (Sciaf). He also shows me experimental vegetable plots - his finca isn't only how he earns money, but is also a "demonstration plot" where he tries out techniques and crops to see if they could be rolled out. Alongside coffee, corn, lettuce and others that are going strong, he is testing potatoes, tomatoes and asparagus.

Back in town, he introduces me to Estela Anzora, manager of Comus. One of the biggest challenges after the war was getting past the suspicion between factions. "We had to help war people to be civilians and help civilians accept war people," she says.

Comus helps 2000 people, in everything from organic coffee production and sales to healthcare, education, water and sanitation. "Comus works with real communities, real people, real jobs. We are not like other people who come and do projects then leave. We are with the people in good and bad," says Coutts.

Life is still tough. There are many who have been disappointed by the years that followed the Peace Accords. I meet Wilbur Castillo, a plumber who works on projects for Comus. He was nine in 1986 when guerillas came to conscript his 13-year-old sister. He volunteered to go in her place. The guerillas gave recruits 'psychological instruction' on what they were fighting for - social justice, human rights, equality - but it was something he understood first-hand.

"I've got children," he says. "I live a very poor life. But my children have shoes on their feet. I didn't have shoes on my feet or food, because my parents were exploited by rich landowners in these times."

The commandante saw something in Castillo and put him into the special forces. He trained as a radio specialist and explosions officer, moving around the mountains and forests of eastern El Salvador fighting government forces. "Your backpack is all you have, your house," he tells me. "In your backpack, you have a piece of plastic. One bit forms a roof, one bit forms the floor; that's what you sleep on. You're trained in arms and their use. When there was food, there was food. When there wasn't much, we learned to put up with it."

It's an incredible amount for anyone to handle, let alone a child. I ask how he coped with war, with killing and seeing others killed. "Through psychological training," he says. "Your blood family is left behind. The moment you cross that line into the guerrilla unit, you're disciplined, you're trained, you're psychologically prepared. Your family is the brothers you have around you. Somebody beside you falls down wounded, bleeds to death, that puts you into overdrive, and you go in with everything."

The war has had a lasting effect. "You always remember your brothers who fell in the war. You always remember the way they went down in front of you, how innocent bystanders got caught in crossfire."

There's an awkward moment when I ask him to stand against a wall for a photo. "You're not going to shoot me, are you?" he jokes. 
On the street in San Francisco, I meet Rafaelo Escamilla, a 59-year-old veteran who was a commandante. He believes the combatants didn't get the country they fought for. "There was poverty before, but now the poverty is worse," Escamilla says. "We fought for social justice. They give us it brick by brick, but the main social change is still to come. They give you an aspirin to take the headache away but that doesn't change the economic structure."

He's also angry that one kind of violence has been replaced by another, due to drugs and organised crime. "There have been changes. The Death Squads were on the rampage - all that got stopped by the accords. But there's another kind of war. That's the war of extortions. These street gangs are indiscriminate; if you don't pay, you get killed. We didn't fight for that type of freedom."

Coutts is also unsure what the Peace Accords achieved. "The accords stopped the war, gave some breathing space, gave some land to people… That's it," he says. He's hopeful, though. Like Wilbur, he sees a great deal to be done improving education and raising living standards. Under the left-wing FLMN government, elected in 2009, things are improving slowly, he says. "Children are getting meals at school, uniforms and shoes. Now there's attention in medical clinics seven days a week."

Does he miss Scotland? "Ooh, aye. It's such a beautiful place, beautiful people. It's great to go back to. I have wonderful memories from childhood. It's lovely seeing what's left of my family. And a haggis supper, a good pint of 80-shilling, a good curry …"

He still feels a deep connection to the country. "Scotland for me is one of the best things that happened in my life. Growing up there meant I had the values from there. Coming out of a civil war is like coming out of an anarchy. You have to establish values and morals. Scotland gave that to me and I used that to help people here." n

Visit comus-elsalvador.org and sciaf.org.uk.