Weeks after Merck & Co. scrapped development of its Covid-19 vaccines in January, one of its senior manufacturing officials began phoning his deputies, telling them their work on a pandemic shot wasn’t actually over.

The twist: Merck would manufacture the vaccine from an arch rival.

“We’re doing it,” John McGrath told his workers at Merck....

Weeks after Merck & Co. scrapped development of its Covid-19 vaccines in January, one of its senior manufacturing officials began phoning his deputies, telling them their work on a pandemic shot wasn’t actually over.

The twist: Merck would manufacture the vaccine from an arch rival.

“We’re doing it,” John McGrath told his workers at Merck. “And we’re doing it with J&J.”

The Johnson & Johnson -Merck partnership, which the companies announced in March, is now bearing fruit to expand the world’s vaccine supply. After a frantic ramp-up that involved scouting for raw materials, buying equipment and upgrading plants all at the same time, the first Merck-made shots shipped Friday.

SHARE YOUR THOUGHTS

How will cooperation in the Covid-19-vaccine race change the future for Merck and J&J? Join the conversation below.

Merck is churning out more than 500,000 doses daily for use outside the U.S., including countries desperate for shots.

J&J’s unusual collaboration with a rival, and Merck’s speedy manufacturing run-up, reflect one of the biggest challenges of the pandemic: making enough Covid-19 vaccines to meet the high demand.

Even in the U.S., early supplies were limited as drugmakers ramped up production lines. To this day, many countries are struggling with short supply.

J&J vials at the Merck plant in West Point, Pa; the first Merck-made shots shipped Friday.

At a sprawling plant in West Point, Pa., Merck is helping J&J with the final stages of its vaccine production, known as fill-finish, which involves thawing frozen doses made by J&J, adding a stabilizer to maintain their potency during storage, then putting them into vials for shipment.

Merck, one of the world’s biggest drugmakers by sales, said it retrofitted its manufacturing facilities in about three months, shaving almost a year off the time it normally takes to ready a plant.

“We broke all sorts of records on construction, on tech transfers, on just getting product ready,” Mr. McGrath said. The federal government, which gave at least $105 million to Merck to retrofit plants, also contributed by moving needed supplies quickly through customs.

Johnson & Johnson’s Covid-19 vaccine hasn’t been embraced by people and health authorities as much as initially expected, partly because of concerns about a rare blood-clotting condition. Manufacturing issues have also played a role in limiting its use.

Yet if enough doses are made, the vaccine still can play an important role in the pandemic because many poor countries lack access to other shots and J&J’s vaccine is easier to handle and store, public-health advocates and Wall Street analysts say.

Workers checking vaccines at the Merck plant in West Point, Pa., which scrambled to get special equipment to manufacture the J&J Covid-19 vaccine.

The J&J vaccine doesn’t require a special freezer to keep it cold, unlike messenger-RNA vaccines, and the primary series is one dose, not two.

“Our vaccine is uniquely positioned to be used in the world,” said Remo Colarusso, J&J’s global pharmaceuticals manufacturing chief. “The world is not completely vaccinated by a long shot.”

J&J and Merck, their headquarters separated by about 18 miles in New Jersey, are normally competitors in areas such as cancer and cardiovascular disease. Last December, at the urging of the federal government, the rivals began discussing whether Merck could help make J&J’s Covid-19 vaccine.

J&J Chief Scientific Officer Paul Stoffels was initially reluctant to work with another company, people familiar with the matter said. He was concerned it would stretch his staff too thin because of existing manufacturing partnerships, but agreed after an appeal by National Institutes of Health Director Francis Collins, the people said.

During a Jan. 4 call between U.S. officials, Dr. Stoffels and then-Merck Chief Executive Ken Frazier, the companies agreed to assess whether Merck’s plants could adapt to make J&J’s shot, the people said.

At the time, Merck was searching for a role in the pandemic response. It had begun clinical trials of two Covid-19 vaccines, but they ultimately failed, with Merck halting the programs in late January. Its Covid-19 antiviral, molnupiravir, was still being tested.

Merck fit as a partner because of its decades of manufacturing vaccines, Mr. Colarusso said.

Another key: Merck’s production line in West Point was sitting idle after the Covid-19 vaccines flopped. Merck also wasn’t using a freshly built 4,000-square-foot cold-storage room with 18 specialized freezers that the company had built for its Covid-19 shots. Each freezer could hold 5.5 million J&J doses.

The freezer room at the Merck plant in West Point, Pa.

The West Point plants sit on a leafy campus 30 miles outside Philadelphia. It is Merck’s largest workplace—in terms of space and number of workers—and has its own ZIP Code. Despite the available rooms and equipment, Merck needed to upgrade its facilities, because J&J’s vaccine uses vials smaller than Merck’s failed Covid-19 shots, as well as a newer vaccine technology.

“Our issue then became what equipment do we need, where can we get it, how quickly can we get it, is it available, and if not, then what’s our alternatives?” said Mr. McGrath, an industry veteran who joined Merck in 2019.

Merck found that it needed to quickly secure equipment and raw materials even as other drugmakers required them for their own products. Merck needed about 200 chemicals and devices such as filters. Such items typically take between two and three months to get, but Merck needed them in weeks.

Merck leaned on its relationships with suppliers, such as Thermo Fisher Scientific Inc., which provided specialized plastic bags used to purify and filter the vaccine. Merck also paused production of some non-Covid-19 products, which might have yielded sales to competitors but freed up equipment and materials, Mr. McGrath said.

In April, workers discovered that a screw used to keep vials steady as they moved down the production line wasn’t working. The vials wobbled, and some fell down, jamming the production line. Merck worked with a vendor in Japan to redesign the screws.

In May, Merck workers discovered another issue with the vials while doing test-runs of the production line using water. They became top-heavy with water when filled. To resolve the issue, a Merck machinist designed a plate that held the containers securely, said Kim Dezura, the West Point plant manager.

“Those are the types of little things that you encounter,” she said. “We want to solve those early so that they don’t create bigger issues later.”

Once filled, vials must be transferred from trays to cardboard boxes for shipment without sustaining damage and before they get too warm. J&J didn’t specify how to do this, so its rival honed its own system.

Initially, Merck tried moving vials one by one, but that took too long and was too physically hard for workers. Using 3-D printers, Merck built workstations for workers to release vials from a tray, sort them into rows, scoop out the containers and transfer them 39 at a time.

In August, Merck began manufacturing commercial doses, Ms. Dezura said. It took the companies until recently to receive regulatory approvals clearing shipments. J&J then got the doses at its distribution center in the Netherlands, and released the doses Friday for global distribution.

Merck plans to make doses with J&J at its plant in North Carolina, a more difficult process that is taking longer to finish.

The Merck site in West Point, Pa., is the company’s largest facility.

Write to Jared S. Hopkins at jared.hopkins@wsj.com

Corrections & Amplifications
Remo Colarusso is Johnson & Johnson’s global pharmaceuticals manufacturing chief. An earlier version of this article misspelled his surname as Remo Colaruso. (Corrected on Dec. 11)