An outbreak of H.I.V. in southeastern Indiana prompted the governor on Thursday to declare a public health emergency as officials worked to stop the spread of the virus that causes AIDS.

Officials said that 71 cases of H.I.V. identified since mid-December have been traced to intravenous use of a prescription painkiller in Scott County north of Louisville, Ky. Nine more cases are still under investigation, and state health officials predicted that more would appear in coming weeks. The governor authorized a short-term exchange program that would provide drug users with access to sterile needles so that contaminated needles were less likely to be shared.

Gov. Mike Pence, a Republican, has long opposed such programs. But he said that the outbreak, which was first identified in late January, had reached epidemic proportions, justifying the action. “This is all hands on deck,” Mr. Pence said. “This is a very serious situation.”

Mr. Pence’s order, which is in effect for 30 days, would allow for a needle-exchange program within Scott County if one is requested by local officials.