The astrolabe was used in the time of Geoffrey Chaucer
A rare 14th Century scientific instrument dubbed the "pocket calculator" of its age is to remain in the UK.
The British Museum has raised the £350,000 needed to buy the Canterbury Astrolabe Quadrant which was uncovered during building work in Kent in 2005.
Culture Minister Margaret Hodge placed an export ban on the item after it sold at auction for £138,000 in March 2007.
It is said to be one of only eight examples in the world.
The British Museum was able to acquire the item used in the time of Geoffrey Chaucer after receiving £125,000 from the National Lottery Heritage Fund, £50,000 from the Art Fund and £175,000 from British Museum Friends and other sources.
The device was used for telling the time, mapping the stars and making height and depth measurements.
'Love of newfangleness'
David Barrie, director of The Art Fund, said: "The Canterbury Astrolabe Quadrant offers an extraordinary insight into the scientific and technological capabilities of Chaucer's England.
"Chaucer himself was an expert on astrolabes and wrote in the Canterbury Tales about men's love of 'newfangleness'."
The British Museum will display the tool, thought to have been made in 1388, next month.
A spokeswoman for the museum said: "Astrolabe quadrants are among the most sophisticated calculation tools ever made before the invention of the modern computer.
"They were an extremely handy tool for their owners, enabling them to carry out timekeeping and other calculations.
"This particular example was made for use with the Sun with the help of the two sighting vanes attached to one side and a now lost plumb-bob.
"Besides enabling the user to determine the date of Easter he could use it to determine the times of sunrise and sunset, the time in equal and unequal hours or the geographical latitude - to name but a few of the many functions."
An anonymous telephone bidder paid £115,000 at Bonhams in London, which rose to £138,000 with auction commission and tax.
The brass instrument was found during excavations for an extension to a restaurant.
The site of the find is known as the House of Agnes, a 17th Century inn on the main road out of Canterbury to London.