David Glass, the former Walmart chief executive who owned the Kansas City Royals for nearly two decades before selling the franchise last fall, died Jan. 9. He was 84.

The cause was complications from pneumonia, his family said in a statement, but they provided no additional information.

Mr. Glass began negotiations early last year to sell the Royals, who reached the World Series twice under his ownership and won the title in 2015. The sale of the team — valued at about $1 billion — was completed Nov. 26. The new ownership group is led by Kansas City businessman John Sherman.

David Dayne Glass was born Sept. 2, 1935, on a farm in Oregon County, Mo., and grew up in the small town of Mountain View, Mo. He served in the Army after high school and later graduated from what is now Missouri State University.

After working for other businesses, Mr. Glass was recruited in 1976 by Walmart founder Sam Walton to be the company’s chief financial officer. Mr. Glass continued to take on a bigger role with the company until 1988, when he was named president and chief executive of the retail giant. Over the next 12 years, he led the company through a period of dramatic growth.

“When we lost my dad, David provided a steady, visionary hand the company needed to lead it forward,” former Walmart chairman Rob Walton said. “He did so with a deep sense of humility while maintaining the values and principles dad founded the company on. More than anyone beyond Sam Walton, David Glass is responsible for making Walmart the company it is today.”

In Kansas City, Mr. Glass helped keep the Royals franchise from leaving the city after the death of founding owner Ewing Kauffman in 1993. Mr. Glass served as caretaker of the organization until April 2000, when he purchased sole ownership for $96 million.

Although the team won two American League pennants and a World Series trophy under his ownership, Mr. Glass was berated for years by the team’s fans for his notoriously frugal ways.

The Royals endured several 100-loss seasons and became known for trading away talented players while refusing to sign notable free agents. Many fans also viewed Mr. Glass as an absentee owner more committed to Arkansas, where he lived, than to Kansas City.

Those views began to change when Mr. Glass hired Dayton Moore as general manager in 2006. Vowing to build a first-class organization, he gave Moore the resources and responsibility to accomplish that objective.

“When I sat down across the table from Mr. Glass, as he began to share his vision for the Kansas City Royals, it was all about wanting to create a model organization,” Moore said Friday. “It was all about putting a competitive team on the field for our fans and our city. I came to understand he owned a baseball team for all the right reasons. It wasn’t about him as an owner, it was about being a great steward of the franchise and preserving the great game he enjoyed as a little boy.”

Mr. Glass continued to attend games in Kansas City until late last season.

“I’m here because where else would you want to be on a Saturday evening but the ballpark?” he told the Associated Press in September, leaning over the dugout during batting practice. “I’m not going to stop enjoying baseball. I went to my first game in 1946 and I’ve been a baseball junkie ever since.”

Baseball Commissioner Rob Manfred said in a statement that “the Royals’ 2015 World Championship was a tribute to his stewardship of the franchise and his passion for baseball in Kansas City.”

Regardless of how he was perceived by the public, Mr. Glass always had the unwavering support of Moore and Ned Yost, the Royals’ longtime manager. Yost said that watching Mr. Glass raise the World Series trophy in 2015, after the Royals defeated the New York Mets, was “one of the top three highlights of my baseball career, because we had accomplished it for him.”

During his ownership of the Royals, Mr. Glass served on several key Major League Baseball committees, including its executive council. He was also a board member of the National Baseball Hall of Fame.

Survivors include his wife of more than 60 years, the former Ruth Roberts; three children; six grandchildren; and seven great-grandchildren.

Mr. Glass’s declining health increased the urgency to sell the club this past fall. After the sale of the team was completed in November, he said, “I will never forget the thrill of seeing over 800,000 people of this community come together on one sunny November day to salute the newly crowned world champions. It’s been a fantastic ride, and I want to thank our great fans for supporting us through the years.”

— Associated Press