Seve Ballesteros, the charismatic Spanish golfer whose imaginative and passionate play led to five major championships and a No. 1 ranking in the mid-1980s, died May 7 at 54. He had a malignant brain tumor.

In October 2008, Mr. Ballesteros collapsed in the Madrid-Barajas Airport and was rushed to a hospital, where tests revealed the tumor. After multiple surgeries and chemotherapy treatments, he spent his last months recuperating at his home in northern Spain, but he never fully recovered.

One of the game’s most revered players, Mr. Ballesteros went from teenage prodigy to major champion to faded, injured star within two decades. From his early 20s, he was considered one of golf’s marquee names until a chronically bad back kept him from competing at his highest level. He retired from professional golf in 2007 but had long been on the fringes as a competitor. His last top-10 finish in a major was at the 1991 British Open at Royal Birkdale. In all, he won 87 titles worldwide, including a record 50 on the European tour.

Mr. Ballesteros was also known for his spirited play in the Ryder Cup, a biennial competition pitting a U.S. team against a squad from Europe. In 1979, the first year golfers from continental Europe were included, Mr. Ballesteros was one of two selections on the European team from outside the British Isles.

His addition to the squad would eventually help change the fortunes of the Europeans, who until 1985 had held the cup only three times since the competition’s inception in 1927. His Ryder Cup record in eight appearances as a player, 20-12-5, is among the best. In 1997, Mr. Ballesteros captained the Europeans to an emotional victory at Valderrama Golf Club in Spain against a heavily favored American team that boasted three of that season’s major champions. Overall, Mr. Ballesteros helped the Europeans win or retain the cup five times as a player and captain.

Mr. Ballesteros, nicknamed “El Matador,” brought flair and exoticism to a game often described as stodgy and slow. His fiery temperament once led him to groom a greenside hedge into a topiary with his putter after he failed to make par.

He earned a reputation as an escape artist because he had a penchant for hitting exceedingly long and frequently inaccurate drives. On one occasion, he sent his ball down the fairway only to have it ricochet off a clubhouse roof.

“Fairway, fairway, fairway is boring, boring, boring,” he once said.

Beyond his magical recovery shots, Mr. Ballesteros swiveled heads with his magazine-cover good looks and attracted swarms of loyal fans to the gallery wherever he played.

“He was Mr. Magnetism,” said Peter Kessler, a former Golf Channel broadcaster and a historian of the game. “All the guys wanted to be him, and all of the girls wanted to be with him.”

Mr. Ballesteros emerged onto the sport’s world stage with a flourish at the 1976 British Open at Royal Birkdale. As a dashing and gregarious 19-year-old, he rocked the golf establishment by leading the tournament for the first three rounds. He ultimately tied Jack Nicklaus for second, six shots behind Johnny Miller.

Three years later at Royal Lytham and St. Annes, Mr. Ballesteros led the British Open in the final round with a chance to shut the door on his closest pursuer, Nicklaus, if he could make one last birdie down the stretch. Mr. Ballesteros saw his opportunity on the 16th hole. He later said that he did not want to hit the ball straight down the fairway and risk a difficult second shot through raging crosswinds.

Instead, Mr. Ballesteros improvised and aimed his drive toward a parking lot where his ball came to rest alongside a white Austin — with a wide-open view of the green. Mr. Ballesteros birdied the hole and beat Nicklaus by three shots to become, at 22, the youngest British Open winner since the late 1800s.

In 1980, nine months after winning his first major championship, Mr. Ballesteros became the first European — and the youngest, until 21-year-old Tiger Woods in 1997 — to win the Masters in Augusta, Ga. He won by four strokes, finishing 13 under par, and legitimized his standing among golf’s elite as the winner of multiple majors. It was a rousing performance, but his American counterparts were less than pleased at the time to see a foreigner swooping in for the big tournaments and pillaging their purses.

“Seve is the one who led the whole next generation of international players. He was the one who broke through and showed what was possible here,” including fame and fortune, Kessler said. “But he never felt like he got the love he deserved. He played with a chip on his shoulder. He just wanted to be one of the guys with the Americans, but they all thought he was coming in and taking money right out of their pockets.”

From 1982 to 1989, Mr. Ballesteros finished in the top five at the Masters six times and won a second green jacket in 1983. Tom Kite, who finished four shots behind Mr. Ballesteros that year in a tie for second, said afterward, “It was like a Chevrolet chasing a Ferrari.”

Mr. Ballesteros always said his greatest major victory was the 1984 British Open at golf’s most venerable venue, the Old Course at St. Andrews.

He started the final round two shots behind Tom Watson, who was seeking his sixth Open title. When Mr. Ballesteros arrived at the final hole, he was tied with Watson, who was playing one group back. Then came what Mr. Ballesteros called “El Momento.”

With victory on the line, Mr. Ballesteros lined up for a 15-foot putt on the 18th green. He watched as his ball curved right-right-right and then impossibly, at the very last inch, dropped out of sight, as if he had willed it into the hole with his eyes.

Watson bogeyed the 17th, while Mr. Ballesteros birdied the 18th. The Spaniard prevailed and won by two with a 12-under-par 276.

Mr. Ballesteros won his final major title at the 1988 British Open, again at Royal Lytham and St. Annes, and he did it in true Seve fashion. He had played surprisingly routine golf throughout the tournament, but on the final day, he had a remarkable 11-hole stretch with two pars, two bogeys, six birdies and an eagle.

“I am not a very mechanical player,” Mr. Ballesteros said in 1990. “I am natural. I am unpredictable.”

Severiano Ballesteros Sota was born April 9, 1957, in Pedrena, Spain, a northern coastal town on the bay of Santander.

He grew up in an agrarian family that farmed for money and played golf for fun.

His uncle Ramon Sota, Spain’s best golfer in the 1950s and 1960s, tied for sixth at the 1965 Masters. His three older brothers were golf pros, but by the time Seve turned 15, he was defeating them all regularly.

He taught himself to play by sneaking at night onto the private course where he worked as a caddy and hitting rocks with the only club he owned: a cut-down 3-iron given to him by one of his brothers.

His three brothers survive him, as do three children from his marriage to Carmen Botin. Their marriage ended in divorce.

Mr. Ballesteros left school and turned professional at 16. He perfected his short game early on and became supremely accurate within 100 yards of the flag.

“He has shots nobody else has thought of,” two-time Masters champion Ben Crenshaw told The Washington Post in 1983. “You may think he’s in trouble, but he’s never in trouble.”

On one occasion, however, after an unusually dismal round at the Masters, a reporter asked how it was possible that the Spaniard, known for his deft hands and gentle touch, had managed to four-putt the par-three 16th hole.

Mr. Ballesteros explained: “I miss. I miss. I miss. I make.”