Hailed by the jury as "solid and confident", The New Library at Magdalene College is the 26th recipient of the prestigious award, which is the most significant in UK architecture.
Niall McLaughlin Architects won a competition to create the New Library at Magdalene College in 2014.
Animated by load-bearing brick walls, gabled pitched roofs and chimneys, its contemporary yet sensitive design pays homage to the architecture of the 700-year-old college at the University of Cambridge.
"Creating a new building that will last at least 400 years is a significant challenge, but one that Niall McLaughlin Architects has risen to with the utmost skill, care and responsibility," he added.
"The result – a solid and confident, yet deferential new kid on the college block."
The New Library at Magdalene College was commissioned as an upgrade to the cramped study rooms in an adjacent 17th-century building.
Accessed through large wooden doors, it provides students with a range of group and independent study spaces open 24 hours a day, as well as an archive and gallery.
Highlights of its gridded interior include a grand double-height reading room, which is enveloped by timber balconies, passively lit and naturally ventilated.
Niall McLaughlin, the founder of the winning studio, said the library was "a work of many hands and many minds" and praised Magdalene College for its ambition.
"The College created the possibility for success in the way that they initiated and managed the project," he said.
"We knew we were building for a client who was motivated to achieve the best outcome," McLaughlin continued. "Our responsibility to the history and future development of this learning community was clear. We were asked to build for the long-term using present resources wisely."
The New Library at Magdalene College is the fourth project by Niall McLaughlin Architects to have been shortlisted for the Stirling Prize, but the first to have won it.
The project is also the first library to win the prize since Alsop & Störmer's Peckham Library won in 2000, and the third building in Cambridge to win the prize after the Accordia housing development by Feilden Clegg Bradley Studios, Alison Brooks Architects and Maccreanor Lavington won in 2008 and the Sainsbury Laboratory by Stanton Williams won in 2012.
Established in 1996, the RIBA Stirling Prize is awarded annually to the building deemed to have made the most significant impact on British architecture.
Last year, it was awarded to Kingston University London – Town House by Grafton Architects. Previous winners include Mikhail Riches' Goldsmith Street social housing and Foster + Partners' Bloomberg HQ.
The photography is by Nick Kane.