The result showed the division of opinion on the issue, as 2,067 people voted ‘yes' to joining the Jura against 1,930 who voted ‘no'.
The narrow (51.7 percent) win for the yes camp was an emotional victory for those who have campaigned for many years in favour of the French-speaking commune leaving German-speaking canton Bern.
Supporters partied in the streets until the early hours of Monday morning, said Swiss media.
The result potentially brings an end to the hugely sensitive ‘Jura question' that has been an issue in the area for more than 70 years.
The separatist struggle dates back to the Second World War when increasing discontent among the French-speaking districts of canton Bern (the Jura Bernois) led, in the 1970s, to a serious of referendums on their future in the canton.
The canton of Jura was created in 1979 to unite those districts who wanted to leave Bern, but at the time only three districts voted to join it, the other four – including Moutier – opting to stay with Bern despite their language differences.
But separatist activism continued, and with an increasingly pro-Jura administration in Moutier in recent years, the tide began to turn.
In 2013 the area voted in another, consultative, referendum, with a majority of people in Moutier expressing their support for the Jura.
It is that referendum which led to the definitive vote on Moutier's future on June 18th.
In an emotional speech on Sunday the town's mayor, Marcel Winistoerfer, hailed the people's historic decision and said “the Jura flame should not go out and will not go out.”
He called for reconciliation between the winning and losing sides for the good of the town, reported news agencies.
In an editorial, Jura paper the Quoditien Jurassien said the result was “coherent” and the right one.
“It would have been paradoxical if the town governed by separatists for more than a generation had decided not to join the Jura.”
It recognized that not everyone in the commune identified with the Jura, and that some “said no because they were scared of change”. But it said the Jura would extend its welcome to all of them “without looking to the past”.
Le Temps agreed the result was “logical” given the separatist majority within the communal authorities, but recognized how divisive the vote was, noting that the separatists had lost some of the majority they held in 2013 and that the town had been left “cut in two”.
“The first winner of this campaign is democracy,” it added, saying there had never been a referendum so strictly scrutinized to ensure a fair vote.
Speaking to the paper Patrick Tobler, a Swiss People's Party politician who backed Moutier to stay in Bern, said the result was a “catastrophe” and that he feared for the prosperity of the town and people's jobs.
But mayor Winistoerfer dismissed the fears of the ‘no' camp, telling the paper that the town would “experience a boom” as part of the Jura.
It will be some time before we will see the effects of the vote. It is likely to take until 2021 before Moutier can actually join its new canton, said Swiss media.
When it does, it will boost the population of canton Jura by ten percent.
Has the decision put an end to the Jura question? Probably not, said the Quoditien Jurassien, since Moutier changing canton is likely to “unbalance” the region.
Indeed, Moutier's decision is likely to influence other, smaller, districts in the Jura Bernois which had promised their own referendums should Moutier vote to leave.
The saga rumbles on.