Mr. Trump is expected to sign the measure, which had already passed the House 405 to 0, in short order.

Congress enacted the original G.I. Bill of Rights, known as the Servicemen’s Readjustment Act of 1944, to provide veterans returning from World War II with support for tuition, low-cost mortgages and low-interest business loans as a reward for their service. The bill was widely considered a success, helping to fuel the country’s postwar economic boom and educate generations of veterans.

Lawmakers passed the current G.I. Bill, commonly known as the Post-9/11 G.I. Bill, in 2008, expanding benefits for those who served after Sept. 11, 2001. With benefits prorated based on the number of months served on active duty, the measure provides up to four academic years of tuition benefits in most cases, as well as housing and book stipends.

The latest bill has been in the works for several years, but gained steam amid a bout of bipartisan productivity on the congressional Veterans’ Affairs Committees this spring. Except for a brief hiccup in April — when a proposal by the chairman of the House Veterans’ Affairs Committee that service members pay to be eligible for the benefits prompted backlash from veterans groups — it was seen as a win for both political parties and the veterans groups. It helps that the Congressional Budget Office has projected that the bill will be cost neutral over 10 years, thanks largely to the slight reduction in monthly living stipends for college tuition recipients.

Leaders of advocacy groups that lobbied for the legislation said lifting the time cap on benefits would probably prove to be one of the most significant changes. Under current law, veterans must use their benefits within 15 years of separating from the military or lose them.

“The ending of the arbitrary date recognizes that we shouldn’t punish veterans and their family members who want to go back to school later in life,” or have to go to work immediately upon returning to civilian life, said Jared Lyon, the chief executive of Student Veterans of America, an advocacy group.