The midfielder has proved to be an influential figure since joining from Benfica five years ago, making 241 appearances for the West London outfit in all competitions.
Reports first emerged earlier this month suggesting that Ramires, whose previous deal was due to expire in 2017, was close to agreeing fresh terms.
Chelsea have now confirmed this news, ending speculation that the Brazil international could be on his way to Juventus as soon as January.
Speaking to the club's official website, the 28-year-old said: "I am very happy to sign a new contract with Chelsea. My family and I are very happy here in London and in the past five years the club has lifted every major trophy. I hope to be an important part of many more successes in the next four years."
Ramires has made 12 appearances for Chelsea so far this season, scoring twice in back-to-back games against Walsall and Newcastle United in league and cup.