UNITED NATIONS — Lawmakers on Wednesday used a rare hearing in the United States Senate to excoriate the United Nations secretary general for what they called his failure to stanch sexual abuse by his agency’s peacekeepers and threatened to withhold crucial funding not only for the United Nations, but also bilateral aid for countries that fail to hold their soldiers accountable.

The United States is the largest single donor to peacekeeping operations, though not many of its soldiers and police serve under United Nations command. The congressional scrutiny came as the United Nations has been roiled by allegations of sexual exploitation and abuse by its blue-helmeted troops, particularly in the Central African Republic.

The allegations emerged a year ago against French soldiers sent to quell the violence in the fragile former French colony. They were accused of sexually abusing children in exchange for food. The allegations spread to soldiers from other countries, serving under the United Nations flag, and they prompted the secretary general, Ban Ki-moon, to start naming countries that fail to investigate and prosecute misconduct by their troops.

The scandal also prompted him, for the first time, to throw out of peacekeeping an entire battalion from the Democratic Republic of Congo. That nation’s army has had a long record of using rape as a weapon of war in its own internal conflicts, and several senior United Nations officials had warned against using its armed forces at all.