WASHINGTON—The White House has given the Pentagon legal authority to target Islamic State in Afghanistan, the first such authorization for military action against the extremist group outside Iraq and Syria, senior administration officials said, in a sign of how the fight has broadened.

The move came in response to a request in December by Defense Secretary Ash Carter for broader authority to expand the fight against Islamic State in the country as the group’s strength grows there, stretching the legal mandate of American forces...