(Adds details and background, market reaction)
ZURICH, April 27 (Reuters) - Switzerland's central bank posted a profit of 7.9 billion Swiss francs ($7.95 billion) in the first quarter, it said Thursday, boosted by gains from the huge foreign currency reserves built up during its long campaign to weaken the Swiss franc.
The Swiss National Bank made a profit of 5.3 billion francs on its foreign currency holdings that rose to 683.18 billion francs at the end of March, a figure larger than Swiss GDP.
The bank also made a profit of 2.2 billion francs from a valuation gain on the gold it holds, and 466.4 million francs from negative interest rates it has charged on the sight deposit accounts it holds for commercial banks.
The SNB is not required to make a profit, with its main mandate to ensure price stability in Switzerland defined as annual inflation of under 2 percent. But a portion of any profit it does make is distributed to the Swiss government and the country's 26 cantons.
Negative interest rates and currency interventions have been the cornerstones of the SNB's policy to tame the franc, which it has consistently described as "significantly overvalued".
A strong franc makes life tough for Switzerland's exporters by making their products more expensive outside the country.
The SNB's currency interventions have led it to being named on the U.S. Treasury's watch list of potential currency manipulators.
But the SNB has also continued to intervene in the currency markets by spending an average of 2.5 billion francs per week this year, according to an analysis of sight deposit account data which serve as a proxy for the SNB's market moves.
The figure is almost twice as high as for the same period in 2016, with the increased activity driven by safe-haven flows into the franc linked to investor uncertainty around the French presidential elections.
The first round of elections -- which put far-right leader Marine Le Pen, who has campaigned for France to leave the euro, in second place behind centrist Emmanuel Macron -- strengthened the common currency against the franc.
Despite the franc's weakening, analysts expect the SNB to remain active in the weeks ahead given the elections in Europe.
"Although the SNB will probably be relieved with the results of the first round in France, which has lessened the need for huge interventions, I think the bank will continue to be active in the currency markets until the presidential and parliamentary elections are completed," said David Marmet, an economist at Zuercher Kantonalbank.
"If it's necessary they will step up their interventions, but they will be hoping the outcome in France will lead to the franc staying at 1.08 or weakening even further to 1.10 versus the euro, which would lessen the need for them to do more."
$1 = 0.9933 Swiss francs Reporting by John Revill; Editing by Michael Shields