Yes, the newly bought shares will have a long-term holding period, regardless of when you sell them. In addition, it's only a wash sale if you sold the first shares for a loss; it's not a wash sale if you sold them for a gain.
Wikipedia mentions this:
When a wash sale occurs, the holding period for the replacement stock includes the period you held the stock you sold.
Example: You've held shares of XYZ for 10 years. You sell it at a loss but then buy it back within the wash sale period. When you sell the replacement stock, your gain or loss will be long-term — no matter how soon you sell it.
Charles Schwab also mentions this:
Here's a quick example of a wash sale.
On 9/30/XX, you buy 500 shares of ABC at $10 per share. One year later the stock price starts to drop, and you sell all your shares at $9 per share on 10/4/XY. Two days later, on 10/6, ABC bottoms out at $8 and you buy 500 shares again. This series of trades triggers a wash sale.
The holding period of the original shares will be added to the holding period of the replacement shares, effectively leaving you with a long-term position.