Staff from departments, including HMRC, will move to the New Waverley development, near the city's main train station.
The move is part of plans to reduce the number of HMRC offices in Scotland to two.
Ministers announced last year that 170 tax offices across the UK would be replaced with 13 regional centres.
HMRC offices across Scotland, including those in Aberdeen, Dundee, Inverness and Livingston, are due to close and be replaced with centres in Glasgow and Edinburgh.
The government has signed a leasing deal for more than 20 years on the New Waverley development, which it said showed the strength of its commitment to services outside London.
Parliamentary Secretary to the Cabinet Office, Caroline Nokes said: "This landmark development will deliver significant benefits to Edinburgh and the communities within it.
"Alongside significant savings for the taxpayer, the roll out of government hubs will provide modern working environments across the whole of the UK that will enable us to provide the best public services we can.
HMRC chief executive, Jon Thompson, added: "Locating HMRC's new regional centre for Edinburgh in the New Waverley development is another step in HMRC's transformation, into a modern, digitally-advanced tax authority.
However, critics have accused ministers of replacing HMRC regional offices without due consultation.
Livingston MP Hannah Bardell said the decision to site the new centre in Edinburgh city centre caused real problems for the 1,100 HMRC staff currently based in her constituency.
She said: "We all know how busy the M8 is. You're talking about a lot of people to put on trains and roads out of Livingston."
The SNP MP also referred to a National Audit Office report that questioned the government's projected costs of the move.
She added: "The National Audit Office report released only a few days before the 2017 election Purdah period, concluded that there was cause for concern about the financial integrity of this and many other HMRC office moves across the UK.
"Specifically, it is not clear that the move to regional city centres will save money as the UK government alleges. In fact, it could well be of greater cost to the public purse."
The UK government is to relocate 2,900 civil servants to a new hub in Edinburgh city centre by 2020.