The Aylesbury Grammar School students dressed as the Jamaican bobsleigh team for a film-themed leavers' day event.
The boys' school said the picture was removed from their feed after complaints.
"It was not the intention of either the students or the school to cause offence," a statement said.
The Walton Road school said the theme for this year's event was chosen by the students, and more than 200 boys took part in depictions of about 150 films and characters.
Four of them, including a boy of mixed-race background, chose the 1993 film based on the true story of the Jamaica national bobsled team's debut in the 1988 Winter Olympics in Calgary, starring John Candy.
Three boys of white British origin "blacked-up" and the group dressed in Lycra outfits and carried a homemade bobsleigh.
Pictures of many pupils were taken on the day, "some of which were posted on Twitter", the school said.
"It appears that one of those pictures caused offence and as soon as this was known the picture was removed," a statement read.
"The school unreservedly apologises for any offence that was caused."
The spokesman added that the school had also accepted "it exercised poor judgment in not acting swiftly when it saw the boys concerned" and had taken steps to ensure it did not happen again.
"All of the students were enjoying their day of celebration and the experience and at no time was there any undertone of any act being of a derogatory or racist nature," the statement added.
A school has apologised after a picture of three "blacked-up" pupils dressed as characters from the film Cool Runnings were posted on its Twitter account.