Harry W. Kelley, 66, the colorful, combative eight-term mayor of Ocean City, Md., died yesterday of arteriosclerosis while on vacation in Fort Lauderdale, Fla.

The gravel-voiced, crewcut Mr. Kelley personified the popular resort town where he was born, and which he served as a lifeguard, city councilman for 16 years and mayor since 1970. Over the years, he defended the town from oil slicks, ocean dumping of sludge, topless bathers, obscene T-shirts, gamblers, federal agencies and acts of God.

When storm-tossed waters of the Atlantic threatened its beaches, he hired bulldozers to spread new sand and hold back the sea's ravages. When a gasoline shortage threatened to keep tourists away in 1979, he bought black-market gasoline, hoarded it and resold it at a town-subsidized rate to visitors for the trip home.

During the summer, he stalked the miles of boardwalk, handing out keys to the city in an abundance matched only by the money those tourists spent on hotel rooms and hard-shell crabs. Facts notwithstanding, Mayor Kelley annually announced that tourism had increased 20 percent over the preceding record year.

Like the mayor of the fictional resort city in "Jaws," who refused to warn bathers of the danger of sharks, Mr. Kelley admitted that he would never "see" a shark offshore, nor the oil that occasionally gunked up the 10 miles of beaches that made the town one of the more popular resorts on the East Coast.

When the Army Corps of Engineers, which is responsible for the nation's shorelines, opposed his bulldozing plan, he pledged to go to jail rather than place the protection of "mole crabs, mussels, clams" above tourists. Acting Governor Blair Lee III said Kelley "protects his city like a mother tiger."

In a letter to an editor, who had questioned whether there had been an overbuilding of high-rise condominiums, the mayor wrote, "I am in love with the ocean, beach and all that encompasses us."

But he too was worried that the condo owners, whom he once denounced as "Montgomery County socialites . . . the cocktail crowd . . . people who play golf" might try to establish voting residence and ruin the family atmosphere of the resort -- or worse, challenge his benevolent dictatorship.

When anyone criticized his beloved town, he fought them with the zeal that had earned him the name "Canvasback Kelley" during his boxing days as an undergraduate at Duke University in the late '30s.

As recently as five years ago, although 50 pounds over his fighting weight, Mr. Kelley took out an ad challenging a local editor, who had suggested the mayor was fixing parking tickets for favored tourists, to "join me in the in ring where right (my fist) can be master of might (your pen)."

He ran for governor three years ago, characterizing his style as "colorful, charismatic and so forth," but he was a fish out of water.

Maryland Gov. Harry Hughes, whom Kelley challenged in the 1982 Democratic primary, said yesterday that Mr. Kelley's "fighting spirit, feisty manner and relentless work on behalf of Ocean City made him a household word throughout the state. In many ways, Harry Kelley was Ocean City."

Baltimore Mayor William Donald Schaefer said "people may not have liked him personally -- he was abrasive -- but they knew he was working for Ocean City. Harry was a nonconformist. He fought for what he thought was right. He was an institution."

Maryland House Speaker Benjamin Cardin called Mr. Kelley "one of the most colorful people in Maryland politics, a real champion of keeping Ocean City for families."

A spokeswoman at City Hall said Mayor Kelley was hospitalized in New Castle, Del. earlier this month, for internal bleeding. He was released last Thursday and left the next day for Florida, where he was visiting an old friend, Bill Bunting, and attending a meeting of the Five States Horsemen's Assocaiton.

City Council President Granville Trimper will serve as acting mayor.

The mayor, who lived alone in a modest home near the renovated town hall, is survived by his wife, Constance, who has been in a nursing home in Salisbury, Md., for many years; two daughters, Constance Collins and Ethel Moran; and three grandchildren.