UNITED NATIONS — Increasingly worried about the spread of Islamist militant extremism reaching its own doorstep, Saudi Arabia donated $100 million to a fledgling United Nations counterterrorism agency on Wednesday and expressed hope that such an infusion — 10 times what the Saudis gave to help create the agency three years ago — would strengthen its abilities and set an example for other donor countries.

The money was the second big contribution by Saudi Arabia to the United Nations in the past few months, largely in response to crises caused by the ascent of radical Sunni Islamist militancy in the Middle East.

On July 1, Saudi Arabia provided $500 million to United Nations humanitarian relief efforts in Iraq, where hundreds of thousands of people have been uprooted by the Islamic State in Iraq and Syria, a marauding force that many counterterrorism experts now regard as a leading threat.