The gas-fired station, operated by SSE, won the £15m contract to keep capacity open when other sources such as renewables cannot meet Scottish demand.
The deal will run from April next year until September 2017.
Scottish Power announced it was to close its huge coal-fired power station at Longannet in Fife early next year as a result of the decision.
It had previously indicated that the plant would have to shut if it did not win the contract.
However, Jim Smith, SSE's managing director of energy portfolio management, said:  "This announcement is positive news for Peterhead.
"SSE has continually invested in the site since it opened in 1980 and we're pleased Peterhead will continue to play an important role in ensuring National Grid can provide system stability and resilience going forward."
National Grid said Peterhead had been selected because its proposal was "determined to be the most beneficial across a number of factors".
It said: "These include the ability to provide system stability and resilience, and value for money for GB consumers."
A major contract from the National Grid has been described as "positive news" for Peterhead power station.