HP Inc. agreed to buy Samsung Electronics Co.'s printer business for $1.05 billion, a deal designed to help the Silicon Valley company expand into high-volume devices that handle printing and copying for office work groups.

The transaction, which is subject to regulatory approval, is expected to close within 12 months, the companies said Monday. After it is completed, Samsung has agreed to make an equity investment of $100 million to $300 million in HP through open-market stock purchases.

HP, created as part of the breakup of Hewlett-Packard Co. last fall, sells personal computers but gets most of its profit from supplying ink and toner for the printers it sells. It is the market leader in the desktop-class printer segment.

That business hasn't been growing lately, in part because PC users print fewer pages these days. HP last month reported that revenue from ink and toner supplies declined 18% in the third fiscal quarter from the year-earlier period, while printer hardware unit sales were down 10%.

Dion Weisler, HP's chief executive, has vowed to spur revenue growth by moving into larger printer-copier combinations known by the designation A3, the stronghold of such companies as Xerox Corp., Canon Inc., Ricoh Co. and Konica Minolta Inc. Samsung already has a business selling A3 machines, which HP will acquire in the deal.

HP will also acquire the ability to manufacture the crucial mechanisms inside laser printers, known as printing engines. Samsung developed the printing engines used in its own laser printers, while HP has always used external suppliers for these components.

Enrique Lores, president in charge of HP's imaging and printing business, said acquiring printer engine technology would both bolster its profit margins and help it shape the evolution of its laser printers. "You have control over the core technology," he said. "That is very, very important."

The deal includes about 6,500 of Samsung's printing-related patents, which Mr. Lores said would also help HP expand its business. Around 6,000 Samsung employees will join HP, including about 1,500 engineers, he said.

Samsung has been slimming down its business portfolio under the leadership of the conglomerate's vice chairman and heir apparent, Lee Jae-yong, and increasing its focus on its market among other technology companies, said Lee Sei-cheol, an analyst at NH Investment & Securities, adding that the deal can be seen as a bid to strengthen the South Korean company's better-performing areas.

The world's top maker of smartphones, memory chips and refrigerators, it ranks fifth in the global hard-copy peripherals market by shipments with a 4% market share, behind global majors HP, Canon, Seiko Epson Corp. and Brother Industries Ltd. Samsung's shipments declined by 8.9% in the second quarter compared with a year earlier, according to research firm IDC.

Samsung doesn't break out separate sales figures for its printer business, which falls under the consumer electronics division that sells televisions and home appliances such as refrigerators and washing machines. Last year, consumer electronics contributed to just 4.7% of the company's operating profit, while the higher-profile smartphone and chip divisions generated 38.4% and 48.4%, respectively.

Amit Daryanani, an analyst at RBC Capital Markets, estimated in a research note that Samsung's printer business generates $1 billion to $1.6 billion in annual revenue and ranks No. 5 in unit shipments of PC printers. Printing engines account for 10% to 15% of the cost of goods HP sells, he estimated.

Canon is HP's main supplier of printing engines in its existing product line, a relationship Mr. Lores said he expected to continue. Beyond helping HP enter the market for A3 machines, he said, the deal would likely help winnow the number of suppliers in the market.

"We see HP as a consolidator in the market," Mr. Lores said. "We want to drive this consolidation and make it happen."

Besides selling laser printers for the A3 market, HP expects to try to diversify its products with a proprietary technology that evolved from inkjet printers. PageWide, which sprays ink using a print head as wide as the paper being used, can print color pages much faster than traditional inkjets, whose printer heads move back and forth across a page, and at a lower cost than laser printers.

Write to Don Clark at don.clark@wsj.com