WASHINGTON — Customs officers stationed at the American border and at airports searched an estimated 30,200 cellphones, computers and other electronic devices of people entering and leaving the United States last year — an almost 60 percent increase from 2016, according to Homeland Security Department data released on Friday.

Despite the surge, Customs and Border Protection officials said the searches affected fewer than 1 percent of the more than 300 million travelers who arrived in the United States last year.

Homeland Security officials say border searches are an important investigative tool and are used sparingly by its agents.

“In this digital age, border searches of electronic devices are essential to enforcing the law at the U.S. border and to protecting the American people,” said John Wagner, the deputy executive assistant commissioner at Customs and Border Protection.