WASHINGTON — Although the Supreme Court split between conservative and liberal justices in one of its most high-profile cases — a 5-4 ruling that said federal judges could not referee disputes over partisan gerrymandering — the court's just-ended term was notable for a series of unusual lineups.

The court divided along the typical ideological lines only seven times, with justices appointed by Republican presidents on one side and those appointed by Democrats on the other. After the bruising hearing for the court's newest member, President Donald Trump's nominee Brett Kavanaugh, the court seemed determined to keep a low profile and to avoid being perceived as a partisan body.

Kavanaugh turned out to be the justice most often in the majority. He joined with the court's liberals in allowing iPhone customers to sue Apple over pricing in the App Store, and in blocking the execution of a Texas death-row inmate after the state refused to let him have his Buddhist priest in the lethal injection chamber.

Kavanaugh was in the majority in 91 percent of the term's decisions in which he participated, slightly more than Chief Justice John Roberts. Justice Neil Gorsuch, Trump's other appointee, and Justice Clarence Thomas were least often in the majority.

Roberts, however, voted more often, because Kavanaugh did not take part in cases that he heard previously as a judge on the federal Court of Appeals in Washington.

The two Trump justices were on opposite sides in almost half of the opinions that were not unanimous, including rulings in which the high court found that separate prosecutions for the same offense in state and federal court do not violate the protection against double jeopardy, tossed out a lawsuit over political boundaries for the state legislature, and narrowed the grounds for prosecuting some federal crimes.

They also split in December when the court refused to hear appeals from states seeking to prevent Medicaid patients from using the services of Planned Parenthood. Gorsuch joined a dissent written by Thomas, who said the cases were not about abortion. Then Thomas asked: "So what explains the court's refusal to do its job here? I suspect it has something to do with the fact that some respondents in these cases are named 'Planned Parenthood.'"

But Kavanaugh and Gorsuch were together in one of the court's most unusual lineups, as the justices struck down a provision of federal law that prevented the government from issuing trademarks considered "scandalous" or "immoral" — a victory for a California man whose clothing line bears the word "FUCT." They joined fellow conservatives Thomas and Justice Samuel Alito and liberal justices Elena Kagan and Ruth Bader Ginsburg in the majority.

The term was also notable for the hot-button cases the court put off until next year or avoided entirely. It declined to rule on whether business owners can refuse to provide their services for same-sex weddings based on their religious beliefs. But next year, the court will consider whether existing anti-discrimination laws make it illegal to fire employees on the basis of their sexual orientation.

The court declined to hear a challenge to the federal ban on bump stocks — devices that allow a rifle to be fired rapidly like a machine gun — that went into effect in March. But next year, the justices will take up the first gun-rights case they've heard in almost a decade. It's a challenge to New York City's restriction on transporting guns outside the city limits. Some gun-control advocates were hoping the city will repeal the law in order to keep the gun issue from being taken up by the Supreme Court.

Even though the Justice Department has repeatedly urged it to act quickly, the court waited until the last day of the term to say it will take up the government's appeal of lower court rulings requiring the Trump administration to continue the Deferred Action for Childhood Arrivals program. DACA allows children of illegal immigrants to remain here if they were younger than 16 when their parents brought them to the United States and if they arrived by 2007. The White House has been trying for almost two years to shut down the Obama-era program.