The Federal Aviation Administration cleared Boeing to make fixes to the battery system of the 787 Dreamliner. That paves the way for the aircraft to start flying again.

Nearly 50 Dreamliners have been grounded for the last four months, after two fires on Japanese jets prompted the FAA to order the planes grounded on Jan. 16.

Since then, Boeing (BA) has redesigned the battery system. Next week, all airlines that have the 787 aircraft will start to install the new systems with the help of special teams deployed by Boeing, said spokesman Marc Birtel. He couldn't say when the 787 Dreamliners would begin flying again.

Boeing basically revamped the internal battery components to minimize the chances of a short circuit. It also improved the insulation of the battery cells, and created a new "containment and venting" system that is supposed to prevent overheating from affecting the plane.

"Safety of the traveling public is our number one priority. These changes to the 787 battery will ensure the safety of the aircraft and its passengers," said Transportation Secretary Ray LaHood.

The move to approve the planes for flight has been expected. FAA Administrator Michael P. Huerta predicted at a Senate hearing on Tuesday that it would happen soon.

Boeing has already completed 20 tests with the new battery technology, Huerta said during that hearing.

United Airlines (UAL), which has six of the jets, is the only U.S. airline to take delivery of the Dreamliners so far. Boeing's customers are eager to get them into service, since they use lightweight composite materials that greatly improve fuel economy.

The Dreamliner has sold well in Asia and the Middle East, where airlines depend on long-range flights for much of their business, and can benefit most from the improvements in fuel economy.

The problems with the new battery technology have already prompted Boeing's European rival Airbus to revert to standard nickel-cadmium batteries in its A350 plane. The A350 had been designed to compete with the Dreamliner, and is due to make its first test flight in the middle of this year.

The approval for the battery fix comes just a few days before the National Transportation Safety Board, which investigates traffic and aircraft incidents, will convene for a two-day investigation into the fires.

Boeing's shares were up 2% Friday afternoon.

-- CNN's Mike Ahlers contributed to this report.