Boeing said Sunday that it discovered after airlines had been flying its 737 Max plane for several months that a safety alert in the cockpit was not working as intended, yet it didn't disclose that fact to airlines or federal regulators until after one of the planes crashed.

The feature was designed to warn pilots when a key sensor might be providing incorrect information about the pitch of the plane's nose.

But within months of the plane's debut in 2017, Boeing said, its engineers realized that the sensor warning light only worked when airlines also bought a separate, optional feature.

The sensors malfunctioned during an October flight in Indonesia and another in March in Ethiopia, causing software on the plane to push the nose down. Pilots were unable to regain control of either plane, and both crashed, killing 346 people.

It is not clear whether having the warning light would have prevented either the Lion Air crash or the March 10 crash of an Ethiopian Airlines Max near Addis Ababa. Boeing's disclosure on Sunday, however, raised fresh questions about the company's candor with regulators and airline customers.

Boeing said again that the plane was safe to fly without the sensor alert, called an angle-of-attack disagree light. Other gauges tell pilots enough about the plane's speed, altitude, engine performance and other factors to fly safely, the company said.

A spokesman for the Federal Aviation Administration said the agency was notified of the non-working warning light in November, after a Lion Air 737 Max crashed on Oct. 29 in Indonesia. He said FAA experts determined that the non-working cockpit indicator presented a low risk.

"However, Boeing's timely or earlier communication with (airlines) would have helped to reduce or eliminate possible confusion," the spokesman said in an emailed statement. He declined to give more details.

In manuals that Boeing gave to Southwest Airlines, the biggest operator of both the Max and 737s in general, the warning light was depicted as a standard feature just as it is on older 737s, according to Southwest spokeswoman Brandy King.

After the Lion Air crash, King said, Boeing notified Southwest that it had discovered the lights didn't work without the optional angle-of-attack indicators, so Southwest began adding the optional feature too. That allowed the airline to activate the sensor-disagree warning lights on its 34 Max jets earlier this year, she said.

King described both features as "supplemental" and "advisory" to other information provided to pilots during flights.

The indicator was supposed to tell pilots when sensors that measure the pitch of the plane's nose appear to conflict, a sign that the sensor information is unreliable. Boeing told airlines that the warning light was standard equipment on all Max jets.

Boeing engineers quickly learned, however, that the warning light only worked if airlines also bought an optional gauge that told pilots how the plane's nose was aimed in relation to the onrushing air. Boeing said the problem stemmed from software delivered to the company. A Boeing spokesman declined to name the software vendor.

Boeing said Sunday that because in-house experts decided that the non-working light didn't affect safety, the company decided to fix the problem by disconnecting the alert from the optional indicators at the next planned update of cockpit display software.

Boeing didn't tell airlines or the FAA about this decision.

Boeing hopes to win approval from the FAA and foreign regulators to get the Max flying again before summer is over. When it does, the company said, the sensor warning light will be standard.

Nearly 400 Max jets were grounded at airlines worldwide in mid-March after the Ethiopia crash. Boeing is working to fix the software that pitched the planes' noses down based on faulty sensor readings, and to provide pilots with more information about the plane's automation.

The Justice Department is conducting a criminal investigation into whether Boeing misled regulators about features on the plane including flight-control software at the heart of the crash investigations. The company is also under scrutiny by congressional committees and the Transportation Department's inspector general, and it faces a growing number of lawsuits by families of the dead passengers.