Seve Ballesteros, the legendary five-time major winning golfer, has died at the age of 54 after losing his fight against cancer.

The news was confirmed by a statement on the golfer's official website which said: "Today, at 2.10am Spanish time, Seve Ballesteros passed away peacefully surrounded by his family at his home in Pedrena.

"The Ballesteros family is very grateful for all the support and gestures of love that have been received since Seve was diagnosed with a brain tumour on 5th October 2008 at Madrid Hospital la Paz."

Ballesteros' brother Baldomero told reporters the funeral will be held on Wednesday in Pedrena, while Miguel Angel Revilla, head of the local Cantabria government, said the region would observe three days of official mourning.

Ballesteros had been recuperating at his home in northern Spain after a series of operations since being diagnosed with two malignant brain tumours in 2008.

His condition worsened on Wednesday, at which point he was admitted to hospital; rumours had swept Spain last week that Ballesteros's situation had taken a rapid downturn. On Friday, Ballesteros was under heavy sedation and his family released a statement confirming his situation had deteriorated.

In an unfortunate coincidence, the Spanish Open – the last competition Ballesteros won as a professional in 1995 – is currently taking place in Barcelona.

José María Olazábal, the golfer closest to Ballesteros and inspired by him since childhood, was too emotional to speak to the media in the aftermath of his Friday round in Barcelona. "I can't talk," Olazábal said. "I can only wait, and cry."

Another Spanish golfer and Olazábal's playing partner, Miguel Angel Jiménez, was in tears upon completion of his second round. Olazábal, Europe's Ryder Cup captain, recently stated his dream that Ballesteros could be alongside him for the meeting with the United States in Chicago next autumn. The pair met a fortnight ago, at which point Ballesteros was in a wheelchair.

Olazábal's manager, Sergio Gómez, reported that Ballesteros's daughter had passed on details of her father's condition on Thursday. "Seve's physical condition was not good when José María went to see him, but they talked about golf and everything," Gómez said. "Then came the call yesterday to tell him that Seve was in a critical condition."

Ballesteros's illness initially came to light after he collapsed at Madrid airport in October 2008; during the intervening period, he has rarely been seen in public. Since his first surgery, which lasted 12 hours, he has undergone almost continuous chemotherapy and radiotherapy. In 2009, after his fourth chemotherapy course, Ballesteros labelled it "a miracle" he was still alive.

In 2010, during his last television interview with the BBC, Ballesteros spoke of fighting cancer. "You can't have it all in life," he said. "One day you feel fantastic, the next you never know what is going to happen. You just take a look at how many days of glory I had before. It has been a fantastic life and this, what has happened to me, is what I will call destiny; one test that God is putting on me."

Ballesteros, who retired from professional golf in 2007, was earlier regarded as a pioneer for the European game overseas. He had turned professional at the age of 16, in 1974, and gone on to share second place with Jack Nicklaus in the Open at Birkdale only two years later, when the winner was Johnny Miller.

He was the first from this continent to claim a Masters title, in 1980, a feat he repeated at Augusta three years later. Ballesteros was the winner of the Open in 1979, 1984 and 1988. Besides winning a total of 87 titles in his career, Ballesteros played in eight Ryder Cups, claiming 20 points from 37 matches. He also captained a successful European team, fittingly on his home soil in Valderrama, 14 years ago.

Ballesteros had not been deemed well enough to make a planned trip to St Andrews to say a farewell to British fans at the time of last year's Open. At the Masters last month, Phil Mickelson dedicated a Spanish-themed champions' dinner to the absent Ballesteros, the man he credits with his own decision to start playing golf.

• This article was amended on 10 May 2011. In the original, Jack Nicklaus was said to have won the 1976 Open at Birkdale.