Rite Aid ( RAD) shareholders approved the drugstore operator's purchase of the Brooks and Eckerd chains from Canada's Jean Coutu Group.

Based on the preliminary tally, more than 97% of the 414.3 million votes cast were in favor of the transaction, Rite Aid said Thursday.

Rite Aid agreed to buy Jean Coutu's U.S. operations in August in a cash and stock deal valued at about $3.4 billion at the time. The purchase will give the company 1,858 more drugstores and six distribution centers, bringing its total store count to over 5,000.

The move will help Rite Aid close in on Walgreen ( WAG) and CVS ( CVS) as one of the nation's biggest drugstore chains, though it still would be smaller than those companies.

"We are extremely pleased with the outcome of today's vote and appreciate the overwhelming support of our stockholders, who understand this is a unique opportunity to accelerate our growth strategy," said Mary Sammons, president and chief executive officer of Rite Aid. "We look forward to working with Brooks and Eckerd associates on a smooth integration and being able to fully realize the opportunities that lie ahead."

The deal is expected to close shortly before the end of Rite Aid's fourth quarter, which ends March 3.