WASHINGTON — The House voted Wednesday to condemn the Trump administration for pushing a federal appeals court to obliterate the Affordable Care Act, and it urged the Justice Department to defend the law in court.

The vote, 240-186, was nonbinding, but it documented the House’s support of the health law, which was passed nine years ago without the votes of any Republicans. With the resolution, Democrats sought to put Republicans on the record for failing to come to the defense of the health law’s most popular provisions, such as protecting people with pre-existing medical conditions and mandating coverage for “essential health benefits,” like mental health coverage, prescription drugs, emergency services and maternity care.

Eight Republicans voted for it. One Democrat opposed.

“The Affordable Care Act is the law of the land, and it is the responsibility of the Justice Department and the administration to defend the law of the land in court,” Speaker Nancy Pelosi of California said. “What are they doing? Just the opposite. Why? Because they don’t believe in governance. That is why they are happy to shut down government.”

The resolution, which expresses the sentiment of the House but is not subject to approval by the Senate or by President Trump, states, “The actions taken by the Trump administration seeking the invalidation of the A.C.A.’s protections for people with pre-existing conditions, and later the invalidation of the entire A.C.A., are an unacceptable assault on the health care of the American people.”