A defibrillator bought by Lavington School will be available for use by the community.
The secondary school in Market Lavington has more than 700 pupils and 80 staff, but its facilities, including its sports hall, are used by numerous clubs.
The defibrillator has cost the school about £1,800 and eight members of staff have been trained to use it. It will be put on an external wall of the school in a secure, but accessible box.
Helen Bennett, pastoral support manager and primary first aider at Lavington School, said it would be good to have one should someone have a heart attack.
She said: “The school is used a lot by the village. Our nearest hospital is miles from here and we thought it would be nice to give something back.
“We have not needed a defibrillator and hopefully we won’t have to use it in the future, but it’s there if we need to.”
Angela Downing, business manager at Lavington School, said: “We have 13 first aiders who update their training regularly. A recommendation they brought back is the importance of community access to a defibrillator. Instant access to this machine really can save a life if someone has a heart attack.
“Lavington School is almost certainly the most heavily populated place within Market Lavington during the school day, but it is also well used after school in the evenings and at weekends by numerous sports clubs and other community groups so lots of people can benefit.”
Dougald Ballardie, chairman of Market Lavington Parish Council, said: “The quicker you can treat a heart attack the higher the survival rate.”
He added that the parish council was looking at buying defibrillators to be located in the village.