The company said the ‘Halfords Autocentre’ business would be a major source of growth for the firm.
In addition to Nationwide’s existing 224 sites, it is expected that Halfords open 200 new centres, creating 1,000 new jobs.
Shares in Halfords surged 10 per cent to hit a five-week high of 432.9p following the announcement. The new price values the firm at £870m.
Halfords hopes the deal will help it double earnings to £20m after three years.
Nationwide, which has been owned by Phoenix, the private equity group, since 2006, employs 900 mechanics and serves about 500,000 customers a year. Halfords shares surged by more than 8 per after the deal was announced.
The company said the rapid increase in demand for its in-store "we fit" services highlighted the opportunities in the car maintenance market.
Chief executive David Wild said: "Our expansion into the adjacent car servicing and repair market is an exciting and logical move for Halfords.
"Nationwide is a high quality business and represents an opportunity for significant growth."
Analyst Matthew McEachran from Singer said: "We believe this is a very good deal for Halfords and offers the group an additional entry point into the structurally attractive car maintenance market.”
Halfords'has been linked with bids for both outdoor leisure group Blacks and privately-owned Hobbycraft in recent weeks.