The 54th international festival in the northern Spanish town also awarded on Saturday a Silver Shell to Natalie Baye, a French actress, for her role in "Mon fils a moi".
The French film is about a mother's obsessional control of her 13-year-old son and his resulting introversion.
Fougeron said he was surprised at the result. "The critics, especially the Spanish critics, were harsh," Fougeron told AFP, "but the public clapped. It's comforting that the jury agreed with the public."
"Half Moon", on the other hand, was a favourite to win the prize, and met with fulsome applause. It earned Ghobadi his second Golden Shell, following "Turtles can Fly", which won in 2004.
The new film tells the story of a group of Iranian Kurds who decide to mark the fall of Saddam Hussein's regime in Iraq by crossing the border to give a concert for their Iraqi Kurdish neighbours.
They spend seven months preparing and then set off in a battered old bus - and they take a woman singer with them despite a ban on public singing by women in Iran.
Ghobadi had told journalists in San Sebastian at length about the difficulties he encountered before, during and after the shoot. He had a very small budget and the Iranian authorities refused to help him.
Silver Shells, meanwhile, went to US director Tom DiCillo for his "Delirious" - a comedy about celebrity-worship - and to Spanish actor Juan Diego for his role in Victor Garcia Leon's "Vete de mi" [Get Away from Me].
The special jury prize went to "El Camino de San Diego" [The San Diego Path] by Argentine Director Carlos Sorin - also about celebrity-worship in that it is the story of a provincial Maradona fan's pilgrimage to Buenos Aires to see the soccer star in hospital with heart failure.
The New Directors award, which goes to a first or second feature by a new filmmaker each year, was won by France's Lionel Bailliu for "Fair Play".
The prizes were set to be officially presented at a ceremony on Saturday evening.