The agreement caps a multiyear pursuit by Hertz, one that survived a rival bid by the Avis Budget Group and a rejection by Dollar Thrifty shareholders of an earlier, lower offer.

Under the terms of the transaction, Hertz will pay $87.50 a share in cash through a tender offer for Dollar Thrifty stock. That represents an 8 percent premium to Dollar Thrifty’s closing price on Friday.

In an important component of the deal, Hertz said it would sell its Advantage Rent a Car discount unit to Franchise Services of North America, a car rental franchiser, and Macquarie Capital.

In a news release, Hertz’s chairman and chief executive, Mark P. Frissora, praised the deal. “We are pleased to have finally reached an agreement with Dollar Thrifty after a lengthy — but worthwhile — pursuit,” he said. “We have always believed that a combination with Dollar Thrifty is the best strategic option for both companies.” He added: “We’ll be a stronger global competitive player with a full range of rental options not only in the U.S. but in Europe and other markets given Dollar Thrifty’s strong international presence.”

In the same release, Dollar Thrifty’s president, chief and chairman, Scott Thompson, said: “After three years of merger-related activity and speculation, I am pleased that we have reached a win-win transaction for both Hertz and Dollar Thrifty.”

The deal is just the latest within the car rental industry, which has experienced rapid consolidation in recent years. Dollar Thrifty, based in Tulsa, Okla., was widely seen as one of the few remaining attractive acquisition targets.

A former division of Chrysler that was spun off in 1997, Dollar Thrifty was nearly forced into insolvency in 2008. Since then, however, it has posted three straight years of rising annual profits, earning $159.6 million last year alone.

Hertz was for many years owned by Ford, which spun off the unit in a 2005 initial public offering. That same year, Hertz was acquired by a private equity consortium led by the Carlyle Group. In 2006, Carlyle again took Hertz public.

The deal between Hertz and Dollar Thrifty has been more than two years in the making, mired in discussions over price and uncertainty over the companies’ ability to win antitrust approval of a transaction. But both companies now believe that, with a concrete plan to sell Advantage, the deal will be blessed by the Federal Trade Commission.

Such is their level of confidence that no breakup fees are payable if the transaction fails, people briefed on the matter said.

Hertz first made a move to buy Dollar Thrifty more than two years ago for about $1.2 billion, or about $41 a share. The bid drew Avis into the race, setting off a heated competition.

Dollar Thrifty shareholders rejected Hertz’s first offer in September 2010, despite a sweetened price, in the face of significantly higher offers from Avis. But antitrust concerns were largely seen as a bigger problem for Avis: analysts viewed the company’s discount business as much bigger than Hertz’s and therefore harder to divest to win antitrust approval.

In June 2011, Avis instead agreed to buy its European arm for about $1 billion, a decision largely interpreted as a sign that the company had walked away from Dollar Thrifty.

And Hertz, despite having offered $2.2 billion in May of last year, also struggled to allay antitrust concerns. Hertz withdrew its offer last October, but maintained it was still interested in Dollar Thrifty — pending F.T.C. approval.

The two companies kept in touch, however, slowly making progress on both price and a solution to their antitrust problems.