WASHINGTON—The U.S. has spent as much as $2.8 trillion on the fight against terrorism since the Sept. 11, 2001, terrorist attacks, according to a study published Wednesday.

The report from the Washington-based Stimson Center think tank said the figure included spending on the wars in Afghanistan, Iraq and Syria, in addition to homeland-security efforts and overseas programs. Spending on counterterrorism reached a peak of $260 billion in 2008, accounting for more than a fifth of the government’s discretionary budget.

The report said the U.S. lacked a system for accounting for spending on counterterrorism and that loopholes have increasingly allowed billions to be spent on items that shouldn’t qualify for emergency funding.

“The Stimson study group found a variety of weaknesses in definitions, tracking, and consistencies that limit accuracy and contribute to a lack of transparency regarding the current data,” the report said. “These weaknesses make it difficult to evaluate whether CT spending has been effective.”

The study notes that the White House Office of Management and Budget’s annual homeland-security report, which tracked spending in different areas of government, has been discontinued this year.