For months, Boeing has said it had no idea that a new automated system in the 737 Max jet, which played a role in two fatal crashes, was unsafe.

But on Friday, the company gave lawmakers a transcript revealing that a top pilot working on the plane had raised concerns about the system in messages to a colleague in 2016, more than two years before the Max was grounded because of the accidents, which left 346 people dead.

In the messages, the pilot, Mark Forkner, who played a central role in the development of the plane, complained that the system, known as MCAS, was acting unpredictably in a flight simulator: “It’s running rampant.”

The messages are from November 2016, months before the Max was certified by the Federal Aviation Administration. “Granted, I suck at flying, but even this was egregious,” he said sardonically to a colleague, according to a transcript of the exchange reviewed on Friday by The New York Times.

The Max crisis has consumed Boeing, and the revelation of the messages from Mr. Forkner comes at a particularly sensitive time. The company’s chief executive, Dennis A. Muilenburg, is scheduled to testify before two congressional committees, on Oct. 29 and Oct. 30, the first time a Boeing executive has appeared at a hearing related to the crashes. Boeing’s stock lost 7 percent of its value on Friday, adding to the financial fallout.

The existence of the messages strike at Boeing’s defense that it had done nothing wrong regarding the Max because regulators had cleared the plane to fly, and potentially increases the company’s legal exposure as it faces civil and criminal investigations and multiple lawsuits related to both crashes. Facing competition from Airbus, Boeing worked to produce the Max as quickly as possible, striving to minimize costly training for pilots. Last week, a task force of 10 international regulators released a report that found that Boeing had not fully explained MCAS to the F.A.A.

[Read the messages between the Boeing pilot and his colleague about the MCAS issue.]

“This is more evidence that Boeing misled pilots, government regulators and other aviation experts about the safety of the 737 Max,” Jon Weaks, president of the Southwest Airlines Pilots Association, said in a statement on Friday.

Boeing has maintained that the Max was certified in accordance with all appropriate regulations, suggesting that there was no sign that MCAS was unsafe.

That contention was central to the company’s rationale in not grounding the Max after the crash of Lion Air Flight 610 last October, and in waiting days to recommend grounding the plane after the second crash, of Ethiopian Airlines Flight 302 in March.

It was only after data suggested that MCAS played a role in the second crash that Boeing and the F.A.A. decided to ground the Max.

Mr. Forkner was the chief technical pilot for the Max and was in charge of communicating with the F.A.A. group that determined how pilots would be trained before flying it. He helped Boeing convince international regulators that the Max was safe to fly.

In the messages, he said that during tests in 2016, the simulator showed the plane making unexpected movements through a process called trimming.

“The plane is trimming itself like craxy,” he wrote to Patrik Gustavsson, a fellow 737 technical pilot at Boeing. “I’m like WHAT?”

Mr. Forkner went on to say that he had lied to the F.A.A.

“I basically lied to the regulators (unknowingly),” Mr. Forkner says in the messages, though it was not clear what he was specifically referring to.

Lawmakers, regulators and pilots responded with swift condemnation on Friday.

“This is the smoking gun,” Representative Peter DeFazio, Democrat of Oregon, said in an interview. “This is no longer just a regulatory failure and a culture failure. It’s starting to look like criminal misconduct.”

Senator Richard Blumenthal, Democrat of Connecticut, said he expected answers from Boeing’s chief executive and board of directors.