WASHINGTON — President Barack Obama and his family plan to move to a mansion in the upscale Kalorama neighborhood of Washington, a mere 2 miles from the White House, when he leaves office in January, according to people familiar with his plans.

Obama, who has said his family will remain in the capital until his daughter Sasha completes high school in 2018, will rent the 8,200-square-foot, nine-bedroom home, the people said, speaking on the condition of anonymity because they were not authorized to reveal his plans.

The house — valued around $6 million, according to several real estate websites, with an estimated monthly rent of $22,000 on Zillow — is owned by Joe Lockhart, a former press secretary and senior adviser to Bill Clinton. Lockhart was until this year the managing director of a communications and political consulting practice he founded, The Glover Park Group, but has moved to Manhattan to become executive vice president for communications for the National Football League.

Lockhart and his wife, Giovanna Gray Lockhart, an editor at Glamour magazine, would not comment on the matter, referring queries to the White House. Jennifer Friedman, the deputy White House press secretary, also declined to comment on the president’s plans, first reported on Wednesday by Politico.

The move will put the Obamas in one of Washington’s wealthiest ZIP codes, in a secluded precinct backing up to Rock Creek Park that is home to diplomats and a focal point of the capital’s cocktail-party circuit. The home itself is luxurious; photographs posted by Washington Fine Properties, which listed it when it sold in 2014, show spacious rooms with hardwood floors, white marble countertops, his-and-her master bathrooms and a terrace with formal gardens.

It also has an “au pair suite” that could be suitable for Marian Robinson, Michelle Obama’s mother, who has lived with the family in the White House.

The location also appears to meet Obama’s need to accommodate the Secret Service contingent that remains with a president after leaving office. A gated courtyard on the side has space for several vehicles and the addition of a guardhouse.

The neighborhood already has a sizable security presence because of its proximity to the stretch of Massachusetts Avenue known as Embassy Row. The Obamas will live down the block from the embassy of Oman and the European Union ambassador to the United States and around the corner from Gérard Araud, the French ambassador known for entertaining often at his Tudor Revival mansion.

“It’s a very quiet neighborhood; that’s part of the reason why all of us like it there,” said Tony Podesta, a well-connected Democratic lobbyist and brother of John D. Podesta, Hillary Clinton’s campaign chairman.

Tony Podesta, who lives two doors from the house the Obamas will rent, invites neighbors for pizza parties in his backyard, where he has a pizza oven. Several times a day, a line of parked taxis snakes down the street, its occupants drawn to the Islamic Center on the block for Muslim prayers.

As news of the Obama’s housing plans became public on Wednesday, journalists and news photographers flocked to the block. “My housekeeper was a little freaked out,” Podesta said.

While the Obamas still own a home in Chicago, the president said in March that his family would remain in the Washington area until Sasha, who attends the Sidwell Friends School, graduated from high school. The Obamas said this month that their older daughter Malia, who graduates from Sidwell next month, would take a gap year before enrolling at Harvard.

Obama’s future home has a rich history. It was built in 1928 by F. Moran McConihe, a real estate developer who played an important role in the expansion of Kalorama and served in the General Services Administration under President Dwight D. Eisenhower.

It was bought by Capt. Charles Hamilton Maddox, a veteran of both World Wars, who in 1912 designed and tested, in-flight, the first successful radio equipment used in naval aircraft. His daughter, Muriel Maddox, acted alongside Marlon Brando in the movie “The Men,” and wrote a number of romance novels.

The neighborhood has long been home to prominent politicians, including Woodrow Wilson, William Howard Taft, Franklin D. Roosevelt, Warren G. Harding, Herbert Hoover and Sen. Edward M. Kennedy. Last year Donald H. Rumsfeld, a former defense secretary, sold the house in Kalorama that he lived in throughout the Bush administration.

Residents describe the neighborhood as an oasis of residential calm in the middle of a bustling city.

“You can get almost anyplace in Washington that you want to go to in 15 minutes, but on the weekend, it’s like you’re in the country,” said Bart Gordon, a former Democratic congressman from Tennessee who is now with the law firm K&L Gates and will soon be the Obamas’ next-door neighbor. “He’ll be welcomed to the neighborhood; I just hope he doesn’t get too rowdy.”

F. Smith contributed reporting, and Kitty Bennett contributed research.