The U.S. government spends over $40 billion a year to compensate veterans and their family members for service in conflicts as far back as the Civil War.

According to an analysis conducted by the Associated Press, the costs of veteran compensation for previous wars are as follows:

$12 billion a year for the wars in Iraq, Afghanistan, and the first Persian Gulf War

$22 billion a year for Vietnam

$5 billion a year for World War II

$2.8 billion for the Korean War

$20 million for World War I

$50,000 a year to 10 living recipients of benefits tied to the 1898 Spanish-American War

Two payments of $876 a year to two children of Civil War veterans

Using federal payment data obtained through the Freedom of Information Act, the AP identified disability and survivor benefits to conduct the analysis.