TEL AVIV—A group of Israeli settlers pelted a U.S. consulate security vehicle with rocks near a West Bank settlement during a visit Friday to investigate allegations that olive trees belonging to Palestinians had been uprooted, according to U.S. and Israeli officials.

The confrontation between U.S. guards and armed settlers—the first of its kind in recent memory—didn’t result in any injuries.

A...