The Internal Revenue Service announced late Tuesday that it would let taxpayers submit tax returns without penalty through Wednesday, after a long day of technical problems that fueled confusion about what is already one of Americans’ most frustrating interactions with their government.

A computer glitch at the IRS knocked offline the agency’s ability to process many tax returns filed electronically, a stunning breakdown that left agency officials flummoxed and millions of Americans bewildered. Senior government officials were at a loss to explain what happened, even as close to 5 million Americans were expected to try to file their taxes before the midnight deadline.

IRS officials did not specify what went wrong, saying only that they would undertake a “hard reboot” of their systems. By late Tuesday, the IRS said that its systems were back online and that taxpayers could proceed to file returns through the end of Wednesday. Taxes had been due on Tuesday. (That was two days later than the usual due date, April 15, which fell on a Sunday. Monday was Emancipation Day, a holiday in the District.)

“This is the busiest tax day of the year, and the IRS apologizes for the inconvenience this system issue caused for taxpayers,” said the agency’s acting commissioner, David Kautter.

An IRS spokeswoman said that “all indications point to this being hardware-related. We’re aware of no other external issues.”

The episode recalled other high-profile government technology breakdowns, such as the challenging launch of the Affordable Care Act marketplaces in 2013, and raised fresh questions about whether the IRS, which has long complained about antiquated computer systems, is prepared for the massive overhaul mandated by last year’s sweeping tax law.

Each year, millions of Americans are required to file tax returns by mid-April for money they earned the prior year. The process can be a financially and administratively painful one, but the IRS is supposed to have sophisticated computer systems that can handle millions of last-minute filers. Between 1 a.m. and 3 a.m. Tuesday, officials discovered that those systems had faltered.

It wasn’t immediately clear how many people were affected or could take advantage of the one-day delay in the filing deadline, but IRS officials said taxpayers wouldn’t have to do anything special to take advantage of the postponement. Many filers who use online tax preparation software, such as TurboTax or H&R Block, or pay their taxes directly to the IRS online were affected. The vast majority of tax preparers, such as accountants, are required to file taxes electronically.

Former IRS commissioner John Koskinen said he was not aware of the agency having to extend the tax filing deadline nationally at any point in the past three decades because of software glitches on Tax Day. Mark W. Everson, another former IRS commissioner, also said he was unaware of any comparable failures at the agency on Tax Day.

The IRS is often at the center of political fights in Washington, with Democrats calling for more funding so the agency can do its job while Republicans have worked for years to pare it back, before agreeing this year to fund the agency at higher levels.

The IRS has faced steady budget cuts for nearly a decade, with its staff size falling by about 18,000 employees from 2010 to 2017 and a recent report showing that it can answer only about 60 percent of calls from tax filers.

The agency is taking steps to implement changes required by a sprawling overhaul of the tax code that Republicans passed in December. It has been working with businesses to make sure they are withholding the correct amounts from employees’ paychecks, as well as rolling out online tools that workers can use to ensure their employers’ calculations are correct.

“The IRS is highly vulnerable to IT breakdowns and cyberattacks,” said Pete Sepp of the National Taxpayers Union, a nonpartisan group that has pushed for changes at the IRS.

Members of Congress expressed frustration with the agency’s performance.

"Unfortunately, it's another example where they're not capable of dealing with the volume," said Sen. Rob Portman (R-Ohio), who has called for reforms at the IRS partly because of the agency's technological shortcomings. 

“This is game day for the IRS, and it seems the IRS can’t get out of the locker room,” said Rep. Greg Gianforte (R-Mont.).

Sen. Ron Wyden (D-Ore.) noted that the agency’s budget has been repeatedly cut in recent years and said this could have contributed to the problems.

“While we don’t yet know what has caused this systems failure, the lack of Republican funding for the IRS to serve taxpayers will only compound the issue. Americans should not be punished for being unable to file their tax returns or pay their tax bills today,” said Wyden, the top Democrat on the Senate Finance Committee, which oversees the IRS.

IRS officials were surprised by the breakdown.

“On my way over here this morning, I was told a number of systems are down at the moment,” Kautter told lawmakers at an oversight hearing Tuesday morning. “We are working to resolve the issue, and taxpayers should continue to file as they normally would.”

“If we can’t solve it today, we’ll figure out a solution,” Kautter said. “Taxpayers would not be penalized because of a technical problem the IRS is having.”

Tuesday’s outage caught at least one White House official off guard, too. Larry Kudlow, President Trump’s top economic adviser, appeared not to know about the problems when asked about them shortly after noon Tuesday.

“The IRS is crashing?” he said, repeating a reporter’s question. “It sounds horrible. It sounds really bad. Hope it gets fixed.”

A spokeswoman for Intuit, the company that owns the TurboTax software, said Tuesday before the delay was announced that taxpayers should continue as usual.

“For those that prepared and filed their taxes with TurboTax earlier today during the IRS system issues, TurboTax is now submitting those returns to the IRS and is currently processing newly filed returns as normal,” an Intuit spokesman said Tuesday night.

The IRS has more than 60 different IT systems for managing the cases of individual taxpayers, according to a report submitted to Congress by an internal IRS watchdog. Many of them have not been updated in decades, and two of them are nearly six decades old — the oldest anywhere in the federal government, the report said.

In testimony in October, two senior IRS officials warned that the agency’s systems were at high risk.

“We are concerned that the potential for a catastrophic system failure is increasing as our infrastructure continues to age. Thus, replacing this aging IT infrastructure is a high priority for the IRS,” wrote Jeffrey Tribiano, deputy commissioner for operations support, and Silvana Gina Garza, chief information officer, in prepared testimony.

In his testimony before Congress on Tuesday, Kautter said the IRS had prioritized the core filing system in its technology spending.

For several hours Tuesday, an erroneous page linked to in the IRS’s online payment section described a “Planned Outage: April 17, 2018 — December 31, 9999.”

While Republicans previously favored scaling back the IRS, the party more recently supported efforts to better support the agency. Congress approved $320 million in short-term funding to help the IRS implement the new tax law as part of the massive budget deal passed in March, but many lawmakers say more money is needed.

The House is scheduled to vote this week on a bipartisan bill making major changes to the agency, including beefing up free tax advisory programs for the poor and giving taxpayers several new rights and protections.

Erica Werner, Ellen Nakashima and Anne Gearan contributed to this report.