Alaska continues to lead the nation in per capita federal spending, but Virginia is closing in, new federal figures show.

Nationwide, federal spending averaged nearly $3,433 per American last year, about $41 more than the year before.The U.S. government spent about $5,421 per resident in Alaska last year, making it the leading state in per capita spending.

But second-place Virginia which moved up from third a year earlier wasn't far behind at $5,317 per capita, according to the Census Bureau.

That $104 per capita difference in spending between the states was down from a $246 spread in 1986.

Maryland, which had been second in 1986, dropped to third place with 1987 spending of $5,113.

Both Maryland and Virginia benefit from their location adjacent to the nation's capital. Many federal agencies have offices in the suburbs, which also are home for consultants and suppliers of goods for the government.

If it were a state, the District of Columbia would easily lead in per capita spending, averaging $23,360.

The report, "Federal Expenditures by State for Fiscal Year 1987," broke down spending totaling $848 billion, covering virtually everything except interest on the national debt.

Direct payments to people took the largest share, totaling $384 billion. That includes Social Security, Medicare, food stamps and other such programs.

Purchase of goods and services was second, with $196 billion spent. Salaries for federal employees totaled $127 billion, with $108 billion sent out to state and local governments and $33 billion spent on research grants, agriculture subsidies and various other purposes.

Per capita, that amounts to $1,555 paid to individuals; $795 in procurement; $514 in salaries; $437 in grants to state and local government and other spending of $133.

Alaska's top finish included high levels of aid to state and local governments as well as pay for federal employees, but it was way down the list in payments to individuals.

Florida topped that category, with Social Security and Medicare benefits for its large elderly population raising the state's average.

California was easily the leader in total federal spending, with its large population, military bases and industry helping bring in $100.7 billion.