Farbrace leaves his post as Yorkshire second team coach after the county "reluctantly" agreed to release him.
The 46-year-old's contract is not due to begin until the new year, however, he is set to join up with the team for their ongoing tour against Pakistan in the United Arab Emirates.
He replaces Graham Ford who opted not to renew his contract, which expires at the end of the year, before taking up an offer to coach Surrey next season.
"Sri Lanka Cricket is pleased to announce to the local and international media the appointment of Mr Paul Farbrace to the Head Coach position of the Sri Lankan national team," a Sri Lanka Cricket statement read.
"The commencement of his contract will be in effect from 1st January 2014 for a period of two years.
Farbrace was an assistant coach to Trevor Bayliss at Sri Lanka from July 2007 and was on the team bus when they came under gun attack in Lahore.
He sustained minor injuries in the attack as the team bus drove to the Gaddafi Stadium in March 2009.
His return to the Sri Lankan team comes three months after Ford announced he would not renew his contract due to family reasons.
"The final decision was made after much deliberation as a selection of Sri Lankan candidates showed commendable credentials as applicants to this post," the SLC statement added.
"SLC wishes to thank Yorkshire Cricket Club for being generous enough to release Farbrace for duty in Sri Lanka."
Yorkshire revealed that Sri Lanka had approached Farbrace on December 7 to take over before granting their permission for him to leave.
"Paul's departure from the club is a loss and I would like to personally thank him for his efforts over the past two years in his role as second team coach," Yorkshire chairman Colin Graves said.
"He goes to Sri Lanka with our blessing and we wish him well in the next chapter of his career. We look forward to welcoming him back to Headingley in June, when Sri Lanka will take on England in the opening Test series of the summer."
Yorkshire's director of cricket, Martyn Moxon, said: "Paul has made a huge impact during his tenure at Headingley.
"He joined at the same time as Jason Gillespie (first team coach) as part of a new coaching structure in 2012 and both have been very successful in our development.
"Paul is an outstanding coach and deserves to take on this role with Sri Lanka Cricket. He has implemented a successful coaching model, which has underpinned our success over the past two years.
"In particular, his expertise in developing junior talent has seen him contribute to provide exciting players for the long-term future of the Club.
"He is a good friend and will always be welcome to visit us at Headingley at any time."
Yorkshire said they would discuss the options to replace Farbrace in the next few weeks, adding that they were in "no rush" to fill the role.