WASHINGTON—The U.S. government ran its largest budget deficit in six years during the fiscal year that ended last month, an unusual development in a fast-growing economy and a sign that—so far at least—tax cuts have restrained government revenue gains.

The deficit totaled $779 billion in the fiscal year that ended Sept. 30, up 17% from $666 billion in fiscal 2017, the Treasury Department said Monday. The deficit is headed toward $1 trillion in the current fiscal year, the White House and Congressional Budget Office said....