It was called the Battle field tax.
The tax was introduced in 1861 by Saloman Chase, the treasury secretary, but it was not seriously enforced. The next year, Abraham Lincoln put some teeth in the bill by signing a bill that was ratified after some debate by the ways and means committee. This was imposed and it was collected. It became the core of the income tax law. The actual bill was repealed in 1872 (it was declared unconstitutional) , but the idea remained.
The Confederacy did the same thing, Americans by then were used to paying an income tax, so the idea was never seriously challenged again.
Governments have only 2 ways of dealing with money: they can increase taxes or they can cut spending. No government likes to do the latter, but they, in theory, don't like doing the former. Eventually they just raise taxes and increase spending. That's when you know a country is in trouble morally.