Willow Financial Bancorp Inc., a Wayne bank that recently gave up its search for a missing $6.2 million, is selling out to larger suburban rival Harleysville National Corp. for $162 million in stock, the banks said today.

The merged bank will have 84 branches, $5.5 billion in assets, and $4 billion in deposits, mostly in Bucks, Chester and Montgomery Counties.

Donna Coughey, Willow's chief executive officer, said the sale to Harleysville had nothing to do with the accounting problems that have delayed Willow's quarterly financial filings with the Securities and Exchange Commission.

"This isn't just something where we woke up and said 'We're out of balance. We need to sell the company,' " said Coughey, who is expected to stay with Harleysville for a year as an executive vice president.

Coughey said she and her board had had "the strategic objective all along" to build a bank that arced around Philadelphia from Chester County to Bucks County.

If anything, she said, the fact that the bank could not determine what had happened to $6.2 million "put our process of looking for a strategic partner on hold."

Paul Geraghty, Harleysville's president and chief executive, said the deal would add to the Harleysville bank's earnings the first year. He said there were no plans to close branches because the networks fit like a "jigsaw puzzle." They will operate under the Harleysville National Bank & Trust Co. brand.

Based on Harleysville's closing price yesterday of $14.08, the value of the deal - reached late that evening - for Willow shareholders is $10.28 a share, a 33 percent premium to yesterday's close of $7.74.

Willow shares today shot up 20.80 percent, or $1.61, to $9.35. Shares in Harleysville were down 75 cents, or 5.33 percent, to $13.33.

The deal, which needs shareholder and federal regulatory approval, is expected to close in the fourth quarter.

It will end a difficult period for Willow, which was formed from the 2005 merger of Willow Grove Bancorp Inc. and Chester Valley Bancorp Inc.

Willow Grove paid $145.3 million for Chester Valley. Now, Harleysville is paying only 12 percent more for the two banks combined.

Geraghty, whose banking roots stretch to Philadelphia National Bank, said Willow shareholders stood to gain when the financial sector stabilizes.

The deal between Willow Grove and Chester Valley brought with it the accounting problems that have bedeviled Willow since last year.

"The only way to describe what we went through was a nightmare," said James E. McErlane, a Willow board member and the largest individual shareholder.

The person who took the fall was Joseph T. Crowley, formerly the chief financial officer at Chester Valley and then Willow. He was demoted this month after the bank's decision to take an $8.3 million write-down for the $6.2 million out-of-balance condition and for the more than $2 million spent on outside help to find out what happened.