Herb Kelleher, the charismatic and colorful co-founder of Southwest Airlines, was hardly a cookie-cutter chief executive. He showed up at company parties dressed as Elvis Presley, invited employees to a weekly cookout, handled baggage during the Thanksgiving rush and brought doughnuts to a hangar at 4 a.m. to schmooze with his airline’s mechanics.

He once arm-wrestled an executive from another company to settle a legal dispute and never hid his fondness for cigarettes and bourbon. Yet he was considered a visionary business leader whose record of sustained success at Southwest led Fortune magazine to ask on its cover: “Is Herb Kelleher America’s Best CEO?”

Mr. Kelleher, a onetime New Jersey lawyer, won a court case in 1971 allowing Southwest to begin operating in Texas.

With its innovative, no-frills approach, Southwest became the country’s most profitable and most imitated airline. Once a feisty upstart, it is now the largest domestic carrier in the United States, with annual revenue approaching $25 billion.

Mr. Kelleher, who held top executive roles at Southwest for more than 30 years, died Jan. 3, at age 87. The Dallas-based airline announced his death but did not provide details on where he died or the cause. He was treated for prostate cancer nearly 20 years ago.

When asked whether his five-pack-a-day smoking habit may have caused his cancer, Mr. Kelleher quipped, “I don’t smoke with my prostate.”

Mr. Kelleher’s instinctive, self-taught management style has been studied in business schools and emulated at countless companies.

“Herb Kelleher is arguably the most transformative figure and character in the history of modern aviation,” Texas oil tycoon T. Boone Pickens said in a tweet.

At Southwest, Mr. Kelleher created what he called a “culture of commitment,” in which employees — not customers — came first. The idea was simple: Happy workers would lead to happy passengers, thus giving the airline a competitive edge.

“What’s important,” Mr. Kelleher told Forbes magazine, “is that a customer should get off the airplane feeling, ‘I didn’t just get from A to B. I had one of the most pleasant experiences I ever had and I’ll be back for that reason.’ ”

Hiring the right people, Mr. Kelleher said, was a leader’s most crucial task. When other companies emphasized education and skills, Mr. Kelleher put a premium on temperament.

“What we are looking for first and foremost is a sense of humor,” he said.

Southwest flight attendants became known for telling corny jokes over the cabin intercom and for silly gags, such as awarding prizes to passengers with holes in their socks.

“Good morning, ladies and gentlemen,” one flight attendant announced, after smoking was no longer permitted on commercial flights. “Those of you who wish to smoke will please file out to our lounge on the wing, where you can enjoy our feature film, ‘Gone With the Wind.’ ”

Mr. Kelleher invited longtime Southwest customers to help screen job candidates. From pilot to baggage handler, attitude mattered. One pilot was rejected because he refused to put on a pair of casual shorts during a group exercise. Another was dismissed for being rude to a receptionist.

“If you don’t have a good attitude, we don’t want you, no matter how skilled you are,” Mr. Kelleher told Forbes magazine in 1991. “We can change skill levels through training. We can’t change attitude.”

As a result, Southwest’s employees had less turnover, more productivity and job satisfaction — and higher pay — than almost any other airline. The company has never had layoffs or pay cuts and is routinely ranked as one of the country’s best places to work.

“Nothing kills your company’s culture like layoffs,” Mr. Kelleher told Fortune in 2001. “You want to show your people that you value them and you’re not going to hurt them just to get a little more money in the short term. Not furloughing people breeds loyalty. It breeds a sense of security. It breeds a sense of trust.”

Labor-union contracts were written to allow workers to move from one task to another.

Pilots sometimes helped clean the cabin, ramp workers collected tickets, counter agents loaded bags. Mr. Kelleher often worked alongside the baggage handlers on the Wednesday before Thanksgiving, the busiest travel day of the year.

Mr. Kelleher despised “the old hierarchical theory of management,” he told USA Today, “which says you have to show you’re in charge by walking around acting like a brick all day.”

Southwest was founded in 1967, when Mr. Kelleher was working as a lawyer for Texas businessman Rollin W. King.

They sketched out a plan on a cocktail napkin, as legend has it, to open a short-haul airline with cheap flights connecting Dallas, Houston and San Antonio. Mr. Kelleher chipped in $10,000 of his own money.

Two other airlines promptly filed suit, claiming Texas was not big enough to support an upstart carrier such as Southwest. After more than three years, Mr. Kelleher prevailed in the Supreme Court of Texas in 1971, and the next day, the inaugural Southwest flight took off.

The company lost money for two years and was forced to sell one of its three airplanes. But by its third year, Southwest was turning a profit.

When a Texas competitor, Braniff Airlines, undercut Southwest’s fare by offering flights for $13, Southwest fought back in a typically inventive way.

“We’d offer customers a choice,” Mr. Kelleher said in 2001. “They could pay $13 — or they could pay $26 and we’d throw in a free bottle of whiskey. That made us the largest liquor distributor in Texas for a couple of months.”

In 1978, Mr. Kelleher moved from corporate counsel to board chairman and later added the title of chief executive, assuming day-to-day control of the business. Southwest steadily expanded from Texas to Louisiana, Arizona, California and, ultimately, nationwide.

The company broke into the Florida market in the mid-1990s by offering $19 fares between Fort Lauderdale and Tampa. With frequent flights and low prices, Southwest made air travel more affordable for millions of people.

“We’re competing with the automobile, not the airlines,” Mr. Kelleher said. “The traffic is already there, but it’s on the ground. We take it off the highway and put it in the airplane.”

From the beginning, Southwest abandoned the conventional “hub and spoke” model of organizing airline routes. Instead, the company focused primarily on point-to-point flights, usually without intermediate connections.

To make repairs and pilot training easier, Southwest used only one kind of aircraft — the Boeing 737. Mr. Kelleher abolished reserved seating and first-class sections. Passengers received plastic boarding cards, distributed on a first-come, first-served basis. After entering the cabin, they chose the first available seats.

Closets were removed from the front of the airplanes because passengers wasted time trying to hang up clothing. There was no cooked food on a Southwest flight, only drinks and crackers or peanuts, which Mr. Kelleher sometimes served himself. (In 2000, the company removed three peanuts from each packet, saving $300,000 a year.)

For all his joking and bravado, Mr. Kelleher was a conservative businessman who understood that an airline could not make money if its planes were sitting on the ground. Southwest became renowned for its fast “turnaround” times, with ground crews beginning their work seconds after a plane arrived at the gate.

One set of passengers filed off the aircraft while a second was waiting to board. Within 15 to 20 minutes, or half the time of most airlines, Southwest had its Boeing 737 back in the air. A Southwest aircraft spent 11 hours a day in flight, compared with the average eight hours at other airlines.

For years, Mr. Kelleher personally approved any company expenditure exceeding $1,000 — “not because I don’t trust our people,” he said, “but because I know if they know I’m watching, they’ll be just that much more careful.”

His formula worked spectacularly well. As other carriers went out of business — Eastern, Pan Am, TWA — Southwest kept flying and kept growing. The airline has earned a profit every year since 1973, and it made Mr. Kelleher a billionaire.

Even so, his office at Southwest headquarters in Dallas was relatively modest, with a standard-issue desk and ashtrays. On Friday afternoons, he invited employees to join him at a weekly cookout on the company’s patio.

“Anybody who seeks wealth as an end in itself is always going to be disappointed,” he said in 1995. “What you really should be doing is seeking excellence in achievement.”

Herbert David Kelleher was born March 12, 1931, in Camden, N.J. He was 12 when his father, an executive with the Campbell Soup Co., died. An older brother was killed in World War II.

As the youngest of four children, Mr. Kelleher became close to his mother, who helped shape his approach to leadership.

“When I was very young — 11 or 12,” he recalled to Fortune in 2001, “she used to sit up talking to me till 3, 4 in the morning. She talked a lot about how you should treat people with respect. She said that positions and titles signify absolutely nothing. They’re just adornments.”

During high school, Mr. Kelleher worked various jobs at Campbell’s, from cook to warehouse foreman, which he called “the best education I ever had. You got to meet the people, see how good they are, how hard-working they are and see some of their eccentricities.”

He graduated in 1953 from Wesleyan University in Middletown, Conn., where he studied English literature and philosophy. He received a law degree from New York University in 1956.

After clerking for a New Jersey Supreme Court justice, Mr. Kelleher practiced law for several years in Newark. In 1961, he moved to his wife’s home state of Texas, joining a law practice in San Antonio.

Mr. Kelleher was an effective trial lawyer, but “every day I went to work,” he told People, “I felt my shoulders droop a little more.”

At Southwest, he worked 14-hour days, then often stayed up late, swapping stories and sipping 101-proof Wild Turkey bourbon. Sleeping only four hours a night, he managed to read two to three books a week.

Survivors include his wife of 63 years, the former Joan Negley; three of their four children; and numerous grandchildren.

Mr. Kelleher retired as Southwest’s chief executive in 2001 and stepped down as board chairman in 2008. Over the years, other companies have tried to copy his business practices, but none has been able to replicate the man himself.

Mr. Kelleher would ride into company gatherings on a Harley-Davidson motorcycle, sometimes singing “Blue Suede Shoes” while dressed as Elvis.

But his favorite stunt came in 1991, when Southwest was threatened with legal action by Stevens Aviation, a small company in South Carolina.

At the time, Southwest’s advertising slogan was “Just Plane Smart.”

The company said it was unaware Stevens Aviation already had the slogan “Plane Smart” as its motto.

Mr. Kelleher proposed that he and Stevens Aviation Chairman Kurt Herwald settle matters with an arm-wrestling match.

“Rather than pay a team of lawyers, Herwald and I decided to wrestle it out at the Sportatorium in Dallas,” Mr. Kelleher said. “It was a hoot. The whole world focused on it. BBC called to interview me in London. I told them I was too busy training.”

In photographs of his “training,” Mr. Kelleher was shown lifting bottles of Wild Turkey in both hands as a cigarette dangled from his lips.

More than 1,000 spectators attended the “Malice in Dallas” showdown.

“In the end,” Mr. Kelleher said, “I got trounced.”

But all was not lost. He and Herwald became fast friends, and they agreed both companies could share the “Plane Smart” slogan.