Mr. Lang poses with graduates of P.S. 121 in 1985. (Chester Higgins Jr./New York Times)

When he rose to speak in 1981 to the graduating sixth-graders at his old Harlem elementary school, Eugene M. Lang had planned, he said, on “mouthing the usual commencement banalities.”

But as the wealthy industrialist eyed the five dozen underprivileged, largely minority students, he could not bring himself to preach to them about the successes that they might never have the tools to reap. He discarded his remarks and recalled to them the Rev. Martin Luther King Jr.’s “I Have a Dream” speech, urging the children to pursue dreams of their own.

And then — with no forethought, he said — he made a vow that would change their lives and his. “I didn’t stop to do any arithmetic,” he told the Associated Press. “I just said, ‘You can go. I promise that each one of you can go to college.’ ”

By his account, Mr. Lang guaranteed each student $500 for every year of college that he or she attended, an amount he later increased. The immediate response, he said, was “the most delightful mob scene a human being can have.”

The principal sought to temper Mr. Lang’s expectations, privately estimating that only a handful of students might take up his offer. But the students defied the school’s sky-high dropout rate. By 1991, 45 of the original cohort had graduated from high school, and 33 were in college, according to the New York Times.

The experience led Mr. Lang to found the “I Have a Dream” Foundation in New York. The initiative, which made him one of the most revered educational philanthropists of his time, reports on its website that it has served 18,000 students through 200 programs across the United States since 1986.

Mr. Lang died April 8 at his home in Manhattan. He was 98 and had Alzheimer’s disease and prostate cancer, said his daughter, Jane Lang.

Like the young audience of his commencement address at P.S. 121, Mr. Lang grew up in poverty — and was the beneficiary of the kindness of a stranger.

Eugene Michael Lang was born in New York City on March 16, 1919, to Jewish immigrants from Eastern Europe. His mother was a public elementary school teacher, and his father was a machinist at the Brooklyn Navy Yard.

Raising their family in a tenement with a toilet down the hall, the couple instilled in their children the importance of education. Mr. Lang graduated from high school at 14 and, amid the Depression, found work as a dishwasher.

One evening, when the waiter became ill, Mr. Lang removed his kitchen apron to serve a nightly customer. When the man asked why he was not in school, Mr. Lang explained that he had already graduated. Did he not wish to go to college, the diner inquired? Yes, Mr. Lang replied, he intended to enroll in the City College of New York. Had Mr. Lang never considered Swarthmore College in Pennsylvania, the man asked?

The diner, it turned out, was a Swarthmore trustee and set up an interview for Mr. Lang. “I was to go to the Harvard Club and I didn’t even own a pair of long pants,” Mr. Lang told the Times in 1985. “I showed up at the club — the portals of heaven — in knickers and a sweater.”

Mr. Lang was accepted at the college, where he ran a laundry operation and sold pennants. He received a bachelor’s degree in economics in 1938, followed by a master’s degree in business and science from Columbia University in 1940.

He was unable to serve in World War II because of flat feet, he told a student interviewer, and began his business career at Heli-Coil, a Queens manufacturer of airplane parts where he became a part-owner. He later formed Refac Technology Development, a company that licensed products and defended their patents. Through the firm, and through frugality that included taking public transportation to work, he became a millionaire many times over.

The beneficiaries of his philanthropy included Swarthmore, to which he donated $50 million in 2012, and the New School in New York, where the Eugene Lang College was named for him. But Mr. Lang seemed to take greatest pleasure in his work with the Harlem students.

“It became so apparent to me that I couldn’t possibly relate to them. I knew the reverse was true, too. We were in completely different orbits,” Mr. Lang told the AP. “I could not accept the fact that I was just passing through. I wanted them to know that I was a good, caring human being and I lived in the same world.”

He made himself personally available to them, counseling them when they faced obstacles such as teen pregnancy and addiction and delinquency. He cheered them at their graduations and helped arrange for jobs. When a student was incarcerated at Sing Sing, he helped him pursue college course work from prison.

In 1998, the New York Daily News reported that some of the P.S. 121 students felt betrayed by Mr. Lang, who they thought had promised a full ride to any college. Mr. Lang acknowledged that $2,000 would not fully cover costs at many institutions but noted that the students also qualified for need-based tuition assistance.

He was honored by presidents including Ronald Reagan, who invited Mr. Lang to the White House, and Bill Clinton, who awarded him the Presidential Medal of Freedom, the nation’s highest civilian honor, in 1996.

Mr. Lang’s wife of 62 years, the former Theresa Volmar, died in 2008. Survivors include a daughter, Jane Lang of Washington; two sons, David Lang and the actor Stephen Lang, both of Manhattan; a sister; eight grandchildren; and eight great-grandchildren.

Mr. Lang described his work with the students at P.S. 121 as the most fulfilling endeavor of his life. “The commitment I made was like getting on a tiger,” he told the Los Angeles Times in 1987, “but I don’t want to get off.”