Image copyright Rex Features Image caption Sir Peter Maxwell Davies was one of the UK's foremost composers

Celebrated British composer Sir Peter Maxwell Davies, a former Master of the Queen's Music, has died at the age of 81.

He was known for his modern and avant-garde works, but his most famous piece was a simple, haunting lament for solo piano - Farewell To Stromness.

"He was, right to the end, a pioneer," Stephen Lumsden, Managing Director of music agency Intermusica, said.

The Salford-born musician, who had leukaemia, died at home in Orkney.

Media playback is unsupported on your device Media caption Will Gompertz looks back at the life of Sir Peter Maxwell Davies

Famous for pushing boundaries, Sir Peter's earlier works have been described as unplayable, generating controversy amongst audiences and critics alike.

He often referenced plainchant and medieval music, which he incorporated into challenging, serial compositions.

In 1969, people shouted "rubbish" at the premiere of his opera Eight Songs for a Mad King; while the inaugural performance of Worldes Blis caused a mass walk-out at the BBC Proms.

"Most of those who stayed booed," Sir Peter later observed. "[It] was very upsetting."

But over his career, he made it his mission to connect with as many audiences as possible, writing pieces for children, ballet, theatre and string quartet.

Media playback is unsupported on your device Media caption In 2014, Sir Peter Maxwell Davies spoke to Will Gompertz about his 10th symphony

Known to most as Max, he composed some 300 works, including 10 symphonies, 10 so-called Strathclyde Concertos and the operas Taverner and The Lighthouse.

He moved to the Orkney Islands in the early 70s, leading to a calmer style of music, which often incorporated Scottish motifs.

In 1987 he was knighted, and in 2004 he became Master of the Queen's Music - a post considered to be the musical equivalent of the poet laureate.

The holder is expected to write music to commemorate important royal events, and the appointment of a self-confessed republican raised many eyebrows.

But Sir Peter told The Daily Telegraph in 2010 that he had become a monarchist after meeting and working with the Queen.

"I have come to realise that there is a lot to be said for the monarchy," he said. ""It is a better system than having a president and frankly I have been disappointed so much with our dishonest politicians.

"They are not telling the truth, any of them."

Image copyright PA Image caption "I have grown to be a huge admirer of The Queen," said Sir Peter in 2010

In the 2014 New Year Honours List he was made a Member of the Order of the Companions of Honour for "services to music".

Last month, he was awarded the Royal Philharmonic Society Gold Medal, considered to be the highest accolade the society can bestow.

'Fierce fighter for music'

As a conductor, Davies held positions at the BBC Philharmonic and Royal Philharmonic orchestras and appeared with many major orchestras in Europe and North America.

He was also a proud advocate of classical music and music education.

"The roots of a thriving classical music scene need three nutrients," he said in the 2005 Royal Philharmonic Society Lecture. "The first is music education, and the second, resources... The third nutrient is new music. Classical music cannot become a museum culture."

"Max was a truly unique musician," said Sally Groves, a close friend and former creative director of music publisher Schott Music.

She added that he was "a remarkable composer who created music theatre works of searing power, great symphonies, intense chamber music, works of truly universal popularity" and "a fierce fighter for music in the community and in education, and on environmental issues".

Image copyright Getty Images Image caption The composer often turned his sights on organised religion, particularly in his early works

Sir Peter was diagnosed with an aggressive form of leukaemia in 2013, but continued to work through successive rounds of chemotherapy.

His tenth symphony, premiered in 2014, his 80th birthday year, was seen as a reply to the illness.

"It felt as if Maxwell Davies was simultaneously bowing his head to mortality, and shaking his fist at it," said Ivan Hewett, reviewing the work for The Telegraph.

But this stage, the former "enfant terrible" had been embraced by the establishment - but he retained his edge, drawing inspiration from the MPs' expenses scandal, and railing against the "artistic terrorists" who let their mobiles ring during concerts.

The composer's most recent work was an opera for children called The Hogboon, which will be premiered by the London Symphony Orchestra on 26 June.

"His vision for music education and the wealth of wonderful pieces he has left for young people is unparalleled in recent times," said the LSO's managing director, Kathryn McDowell. "He will be sorely missed."

BBC Radio 3 will pay tribute to Sir Peter on today's edition of In Tune at 16:30 GMT.