Amazon is no longer exploring building a fulfillment center in Prince George’s County, the company said Friday, following opposition from residents and an appeal in court.

The county council and planning board paved the way for construction of a 4-million-square-foot warehouse in Upper Marlboro, and developers had said they hoped to begin construction as early as this fall. However, residents in the Westphalia subdivision, where the facility would have been located, vocally opposed the project, citing concerns about traffic, the environment and their home values.

“The site is simply not the right fit for Amazon at this time,” Amazon spokeswoman Rachael Lighty said when asked about the change. “Amazon weighs a variety of factors when deciding on future sites. Had the project moved forward, we would have looked forward to being a good neighbor, job creator and driver of economy in the community.”

She said there was not a formal lease agreement in place for Amazon but that there were exploratory discussions about opening in Westphalia, a mixed-use project that broke ground in 2013 but that has struggled to attract retailers.

Maryland is home to 7,000 Amazon employees and “has been a great place to do business,” Lighty said in a statement.

Gov. Larry Hogan (R) has said he is committed to luring the retail giant to Maryland, and his spokeswoman Kata Hall said Friday that the Commerce Department has already reached out to Amazon to offer assistance in finding another site in Maryland.

(Amazon founder and chief executive Jeff Bezos owns The Washington Post.)

County Executive Angela D. Alsobrooks (D), who announced the decision in a separate statement, said she would work with the company “to identify more suitable locations in the county where they may be able to bring their products.”

Alsobrooks had met with both residents in Westphalia and developers. Residents were initially told Westphalia would have a town center similar to those in Columbia or Reston, Va., with bars, restaurants, offices and retail. However, the only major development on the horizon was the warehouse.

“To those who purchased homes at Westphalia and were promised certain things, I want you to know that my administration will work with the developer to help bring the retail, dining and other amenities you were promised,” Alsobrooks said.

Edward Fleming, executive vice president of Walton Development Group, the developer of Westphalia, called the news “extremely disappointing” and said he still believes Westphalia would have been “the best site for the logistics center, which would have brought 1,800 direct jobs and hundreds of indirect jobs to this County-approved site.”

He said the company will continue to assess all options for Westphalia.

Bills passed by the county council in June added “merchandise logistics center” to a list of allowed uses in Westphalia. The planning board approved plans for the project during a contentious nine-hour hearing last month.

About 15 homeowners have been meeting weekly on how to fight the project and have hired a lawyer, who filed appeals of two decisions made by the planning board and two bills passed by the county council.

Warren Sharon, who lives in Westphalia, said he was “very excited” when he heard that Amazon might be pulling back from the project and hopes the county will now move more slowly in finding development that is right for the space.

Sharon said residents are still worried about the zoning change that would have enabled a warehouse to be built in the mixed-use zone, which residents said left them feeling blindsided. He said they plan to talk with their lawyer next week about the future of their fight in court.

Briana Bostic, whose family bought a home in Westphalia last year, said she started crying with relief after hearing about the canceled plans.

“I’m just so, so happy,” said Bostic, a doctoral student at Johns Hopkins University. “But I know we have to be really vigilant — a year from now it could be another warehouse owner.”