Alaska Airlines grounded its fleet of Boeing 737 Max 9 aircraft on Friday after a flight operated by the airline made an emergency landing at Portland International Airport in Oregon that evening because of a midair pressure problem that passengers said blew out a chunk of the fuselage.

The airline said that Alaska Airlines Flight 1282 had made a safe emergency landing carrying 171 passengers and six crew members at the Portland airport shortly after takeoff for Ontario, Calif. Within hours, the company said that it was grounding all 65 of its Boeing 737 Max 9 aircraft until it could inspect each plane. Those planes make up about a fifth of its fleet. It said in a statement that it expected to complete the inspections within a few days.

Boeing’s Max aircraft have a troubled history. After two crashes of Max 8 jets killed hundreds of people within several months in 2018 and 2019, the Max was grounded around the world.

Passengers on Friday’s flight described an unnerving experience during the 15 or so minutes in which the plane was returning to the airport. As yellow oxygen masks dangled above their heads, a powerful wind tore through a gaping hole that showed the night sky and the city lights below.

The crew reported a “pressurization issue” before the emergency landing, the Federal Aviation Administration said in a statement. The Association of Flight Attendants at Alaska Airlines said that the decompression was “explosive,” and that one attendant had sustained minor injuries.

A passenger, Vi Nguyen of Portland, said that she woke up to a loud sound during the flight. Then she saw a large hole in the side of the aircraft.

“I open up my eyes and the first thing I see is the oxygen mask right in front of me,” Ms. Nguyen, 22, said. “And I look to the left and the wall on the side of the plane is gone.”

“The first thing I thought was, ‘I’m going to die,’” she added.

Her friend Elizabeth Le, 20, said she had also heard “an extremely loud pop.” When she looked up, she saw a large hole on the wall of the plane about two or three rows away, she said.

Ms. Le said no one was sitting in the window seat next to the missing fuselage, but that a teenage boy and his mother were sitting in the middle and aisle seats. Flight attendants helped them move to the other side of the plane a few minutes later, she said. The boy appeared to have lost his shirt, and his skin looked red and irritated, she added.

“It was honestly horrifying,” she said. “I almost broke down, but I realized I needed to remain calm.”

There were announcements over the speaker system, but none were audible because the wind whipping through the plane was so loud, she said. After the plane landed, paramedics came on board to ask whether anyone was injured, she added. A man seated in the row immediately behind the hole said that he had hurt his foot.

Ms. Le said the passengers were not given an explanation of what had happened. In a video she took of the flight, passengers can be heard clapping after landing. “Oh my god,” someone says.

After landing, Ms. Le said that she and her friends were boarding another flight to Ontario later that night.

Alaska Airlines Flight 1282 departed for Ontario International Airport at 5:07 p.m. and was diverted back to Portland six minutes later, according to FlightAware, a flight tracking website. It reached a maximum altitude of about 16,000 feet, when its speed was recorded at more than 440 miles per hour, and landed in Portland at 5:27 p.m.

The cause of the midair problem was unclear as of early Saturday. Keith Tonkin, the managing director of Aviation Projects, an aviation consulting company in Brisbane, Australia, said that an excessive difference in the air pressure inside versus outside the cabin could have caused the wall to break off.

Passengers were probably able to breathe normally even when the plane was at its highest altitude, Mr. Tonkin added.

The plane was new, having been certified in November, according to the F.A.A. registry of aircraft. It entered commercial service that month and has since logged 145 flights, according to Flightradar24, another flight tracking site.

Representatives for Alaska Airlines, the F.A.A. and the National Transportation Safety Board said that they were investigating what had happened.

Boeing said in a statement that it was “aware of the incident involving Alaska Airlines Flight 1282,” adding: “We are working to gather more information and are in contact with our airline customer.”

In 2018, Lion Air Flight 610, a 737 Max 8, crashed into the ocean off the coast of Indonesia, killing all 189 passengers and crew members. Less than five months later in 2019, Ethiopian Airlines Flight 302 crashed shortly after leaving Ethiopia’s capital, Addis Ababa, killing all 157 people on board.

The Max planes were grounded after the second crash. Boeing made changes to the plane, including to the flight control system behind the crashes, and the F.A.A. cleared it to fly again in late 2020. In 2021, the company agreed to a $2.5 billion settlement with the Justice Department, resolving a criminal charge that Boeing conspired to defraud the agency.

In December, Boeing urged airlines to inspect all 737 Max airplanes for a possible loose bolt in the rudder-control system after an international airline discovered a bolt with a missing nut during routine maintenance. Alaska Airlines said at the time that it expected to complete inspections for its fleet in the first half of January.

Mark Walker contributed reporting.