The firm was up against four unnamed rivals to win the prestigious contract, which involves advising on matters relating to employment, equal opportunities, health and safety, property and land-related issues, commercial law, procurement and litigation.
Eversheds will also advise on IP and data protection issues. The work will be done from the Cardiff office, led by commercial litigation partner Peter Watkin Jones and property partner Eric Evans.
The core legal work will still be handled by the National Assembly's in-house team.
A spokeswoman for Eversheds says: "The contract was advertised in the legal press across England and Wales so there were a lot of applicants, which were then whittled down to a shortlist of four.
"As well as being the largest legal practice in Wales, the Cardiff office is rated as the leading practice. We have worked a lot with the public sector including a contract with the Welsh Development Agency for the past 10 years. This could have been a major factor in swinging the deal our way.