Bill Veeck, 71, owner of three major league teams and self-described baseball hustler, died of a heart attack yesterday at Illinois Masonic Medical Center in Chicago. He was hospitalized Monday after suffering from shortness of breath, and he had a malignant lung tumor removed in October 1984.

In baseball, Mr. Veeck operated as a free spirit whose light-hearted attitude toward the game's mossy traditions invited the displeasure of baseball's royalists. But they could not ignore his success as a pennant-winning owner with the 1948 Cleveland Indians and 1959 Chicago White Sox.

It was Mr. Veeck's zest for showmanship that helped him generate a 1948 season attendance of 2,620,627 at Cleveland that shattered all previous major league records. He engaged wandering minstrels to serenade the grandstands, imported orchids from Hawaii for Ladies Day fans, provided a baby-sitter service at the park, and broke out lavish firework displays to enliven the Indians' games. Crowds sometimes numbered more than 80,000.

It was written of Mr. Veeck, who was a hero to Cleveland and Chicago fans, that, "He lights up a front office." At Chicago, he originated the $300,000 exploding scoreboard to celebrate hometeam homeruns with a burst of rockets and pinwheels. He gave White Sox fans blaring bands and, on occasion, free beers.

Of those rival club owners who bemoaned his lack of baseball dignity and did not regard him as fit for proper baseball society, he said, "They keep pretty mum while they are taking those fat visiting team checks away from my ball yards."

He broke the American League color line in Cleveland in 1948 by signing outfielder Larry Doby as its first black player. When the mails began to fill with protests, Mr. Veeck responded by signing Satchell Paige, a black pitcher.

It was as the St. Louis Browns owner in 1951 that he most vexed his fellow baseball magnates. When Detroit pitcher Bob Cain was preparing to face the Browns' lead-off hitter in the second game of a double-header, he was confounded to see in the batter's box a 3-foot-7 midget, in a Browns' uniform.

This was little, 65-pound Eddie Gaedel, one of Mr. Veeck's surprises. When the Tigers appealed to umpire-in-chief Ed Hurley to halt this comedy, Mr. Veeck's manager, Zach Taylor, produced a regulation American League contract to which Mr. Veeck had signed Gaedel, and the midget was allowed to play.

Gaedel, with his tiny strike zone from armpits to kneecaps further narrowed by Mr. Veeck's orders to crouch, walked on four straight pitches and was then withdrawn from the game, his purpose served.

Also at St. Louis when Mr. Veeck fired his manager, Rogers Hornsby, he explained: "It was either fire my manager or hire 25 new ballplayers." For this act, Mr. Veeck presented himself with a loving cup in ceremonies at home plate, "In token of his valuable contribution to the team."

Mr. Veeck even made sport of the heavy blows dealt him in his lifetime. As a World War II marine he injured his right leg on Bougainville in the South Pacific in 1943 when a recoiling artillery piece crashed against him. It was amputated below the knee in 1947, and for the rest of his days he hobbled about as an amputee on an artificial limb. Sometimes he lifted his trousers to snuff out a cigarette against his wooden limb, and also was given to jesting, "The only fear I have is of termites."

Almost to the last, Mr. Veeck made mirth of his misfortunes. When he was discharged from a Chicago hospital after his second bout with lung cancer, he said, "That makes two states, Illinois and Maryland, that have now rejected my body."

A deep disappointment of his life was in 1953, when the American League club owners refused to approve Mr. Veeck's move of his foundering St. Louis Browns to Baltimore, a city prepared to welcome him. Some were settling old scores with Mr. Veeck, who had long been demanding that the television revenues of all teams be shared equally.

They voted Mr. Veeck down twice on his projected move to Baltimore, but after he sold the team to a Baltimore group, a move was quickly approved. "I got the message," Mr. Veeck said.

If Mr. Veeck wasn't exactly born to baseball, his early years brought him close to it. His father, a former Chicago sportswriter, became president of the Cubs, and Mr. Veeck broke into the game as a $15-a-week office boy.

By the age of 27 he owned the Milwaukee American Association franchise, and it was there he first exhibited the band-playing and other frills that were to become his trademark. Once, to take the minds of Milwaukee fans off their poor team, he dispatched his musically minded manager Charley Grimm, to home plate to play his guitar.

By the age of 32, he owned a major league team, as head of the syndicate that bought the Indians for $2.2 million. When he sold the team seven years later some of his backers were paid $20 for every $1 they invested with him. Under Mr. Veeck and his frills, the Indians took off. Two years after they drew 400,000 the Indians attendance zoomed to more than 2.6 million and they had the 1948 pennant and a World Series championship in six games over the old Boston Braves.

Mr. Veeck's personal fortune benefited little after he paid off the taxman and a generous divorce settlement to his first wife, Eleanor Raymond, whom he had married in 1935. But he found operating in the big leagues to be easier and more enjoyable than in the minors.

"At Milwaukee it was a big gamble if we had to pay $10,000 for an outfielder we needed. And if he didn't pan out, it could leave us in the red," Mr. Veeck said. "Here in the majors with all that money coming in all the time, you'll pay $100,000 for a player and if he flubs you simply cover your mistake by buying another player for a hundred grand, and thus maintain fan interest."

Sartorially, as well as in his operations, he wore no man's collar, preferring tie-less, flaring sports shirts that exposed his hairy upper chest. Hats, too, were out. About neckties, he liked to quote Ted Williams: "They only get in your soup." Hatless, he was otherwise recognized by his close-cropped, tightly curled red hair, later to turn white, that was another of his badges.

In restaurants, Mr. Veeck was a check-snatcher and heavy tipper, a big mover in Toots Shor society. He was a three-pack-a-day cigarette smoker with beer intake to match before he gave up both on doctor's orders in 1980. As for his ubiquitous public life, he once explained, "I admit it, I'm a publicity hound."

After selling the Indians, his next venture was as owner of those renowned losers, the St. Louis Browns, which he bought for $1.5 million in 1951. In St. Louis Mr. Veeck built an apartment for his family inside the park, to be nearer his operations. His second wife was the former Mary Frances Ackerman, advance publicist for the Ice Capades, who was often called "The World's Most Beautiful Press Agent."

The Browns continued to lose games and money and by 1953 Mr.Veeck was maneuvering to get out. "I knew we were dead in St. Louis when Gussie Busch with all that money bought the Cardinals. We couldn't compete."

Mr. Veeck got a temporary financial fix by selling Sportsman's Park to Busch for $800,000 and then turned his eyes toward Baltimore, only to be slapped down by the votes of AL club owners. He sold the team to Baltimore interests.

For the next few years he retired to his farm in Easton, Md., inappropriately named "Tranquility." In addition to Mr. Veeck and his wife, "Tranquility" was headquarters for most of his nine children from two marriages, various breeds of dogs, a chicken flock and various assorted animals. Also it was a mecca for a stream of visitors curious about Veeck's life in retirement.

At "Tranquility" Mr. Veeck also resumed his love affair with books, explaining, "I was a Kenyon College drop-out." He doted on Shakespeare and Will Durant's seven volumes on The Story of Civilization. He was a regular book reviewer for the Chicago Tribune and other newspapers, and with writer Ed Linn, authored his biography, "Veeck as in Wreck."

He also went on the lecture circuit and took a one-year turn as commentator on Roone Arledge's Wide World of Sports for ABC. He found time too, to testify for Curt Flood in that player's defiance of baseball's reserve clause, further angering the clubowners.

In 1969, he was coaxed out of retirement to operate the Suffolk Race Track in Boston by owners who valued his promotional talents.

Though new to the business, Mr. Veeck pumped up interest in Suffolk by eliminating the clubhouse and making it a one-price track, declared all pay toilets to be no-charge conveniences and otherwise won the fans' approval.

"I had to read up on racing quickly," Mr. Veeck said. So he wrote to his favorite Brentano's in his native Chicago, ordering every book it had on horses. "They sent me 20 volumes. Some of them were very helpful," Mr. Veeck said, "but I doubt I reaped any benefits from the illustrated 'Black Beauty' they sent along from their juvenile department."

He entertained Suffolk fans with a Lady Godiva Handicap for female drivers, and for male and female jockeys he concocted a Guys and Dolls Handicap. Then he imported from Hollywood some of the props from Ben Hur and staged a bona fide chariot race on the Suffolk track.

When, in 1971, he fell out with the owners despite the track's success, Mr. Veeck noted his experience in racing by writing what he liked to call "the definitive on Suffolk." He impishly titled it "Thirty Tons a Day," an allusion to the daily output of the 1,600 horses stabled there.

He was coaxed back into baseball in 1975 by the opportunity to rebuy the White Sox, 14 years after after selling that same team for what he said were "reasons of health." With his longtime friend Hank Greenberg as his chief partner, he operated the White Sox until 1980 when he sold for $20 million the franchise his group had bought five years before for $7 million.

Survivors include his wife; four daughters, Marya, Lisa, Juliana and Ellen Maggs; four sons, Michael, Gregory, Christopher and Peter; six grandchildren; and a sister, Margaret Ann Krehbiel.