The new contracts ensure that the duo will remain with the series for a potential 11th and 12th season.

Patrick Dempsey and Ellen Pompeo are staying put in Shondaland.

The stars of ABC's long-running medical drama have inked new two-year deals to remain part of Grey's Anatomy for potential 11th and 12th seasons, The Hollywood Reporter has learned.

PHOTOS: 'Grey's Anatomy's' Famous Departures

The new pact does not guarantee that Grey's will continue its run beyond its current 10th season; the series has not yet been formally renewed but it remains a valuable asset for ABC. In its 10th season, the series is tied (with Scandal and Agents of SHIELD) as the network's top series among the advertiser-coveted adults 18-49 demographic with a 4.7 rating. Among total viewers, Grey's is third at ABC, trailing Castle and Scandal, with the fellow Shonda Rhimes drama Scandal outperforming Grey's in the metric by about 200,000 viewers.

The decision to lock up Pompeo and Dempsey -- who have been the central pair on the medical drama since its inception -- comes as Grey's prepares to bid farewell to one of its original and most beloved castmembers when Sandra Oh exits the series at the end of season 10.

STORY: Sandra Oh to Exit 'Grey's Anatomy' (Exclusive)

Dempsey and Pompeo inked new one-year deals to return through season 10 in May 2012, ahead of the show's formal renewal. Co-stars including Oh, Justin Chambers, James Pickens Jr. and Chandra Wilson all signed on for two-year runs at the same time. The contracts for the remainder of the cast -- including Sara Ramirez -- expire at the end of this season. No additional details about contract renewal talks with the remainder of the cast were immediately available.

The move to lock up Dempsey and Pompeo for two more years comes as the beloved on-screen couple remain huge stars not only in the U.S. but internationally, where the series is beloved by millions of fans worldwide.

The contract extension also gives showrunner Rhimes the security to pen a storyline for Dempsey's Derek and Pompeo's Meredith knowing that the duo will remain with the series. In the past, contract talks have stretched into May and forced the writing staff to accommodate the then-uncertain future of its stars.

PHOTOS: The Couples of Shondaland: 'Grey's Anatomy,' 'Private Practice,' 'Scandal'

Dempsey is repped by UTA, Burstein Co. and Stone Meyer; Pompeo is with WME, John Carrabino and Hansen Jacobson.

Email: Lesley.Goldberg@THR.com

Twitter: @Snoodit