The Federal National Mortgage Association, taking advantage of a change in accounting rules for fee income, yesterday reported a sharp increase in annual profit.

The association reported income of $376 million ($4.63 per share) for 1987, compared with $105 million ($1.42) in 1986.

In the fourth quarter, Fannie Mae, as the company is called, reported income of $195 million ($2.40), nearly five times the $42.2 million (57 cents) in the 1986 fourth quarter.

The main reason for the sharp increases in earnings was the adoption of an industry-wide rule that requires lenders to take steps to amortize certain fee income over the life of loans, rather than including it in profits all at once. The rule goes into effect for all lenders in 1988, but companies were given the option of using the new rules to calculate 1987 financial results.

According to officials at Fannie Mae, which buys mortgage loans from saving and loans around the country, the adoption of the new rule resulted in a one-time windfall for 1987. This windfall was partially offset by Fannie Mae's decision to sell certain low-yielding mortgage assets and repurchase some high-coupon debt, as well as other steps.

Without the changes, Fannie Mae said its 1987 earnings would have totaled $230 million ($2.83), compared with $183 million ($2.46) a year ago.

In other earnings results:

First Virginia Banks Inc. reported earnings of $56.3 million ($2.75), up 11 percent from $50.5 million ($2.49) in 1986. In the fourth quarter, income was $13.8 million (67 cents), an increase of 16 percent over the $11.8 million (58 cents) in the same period a year ago.

The company attributed the improved earnings to increased net interest income and control of noninterest expenses. First Virginia also cited the quality of its portfolio, which includes no foreign loans and no problem loans in the energy and farm sectors.

Dominion Bankshares of Roanoke reported an increase in profit of 30 percent in 1987, earning $70.6 million ($2.10) compared to $54.3 million ($1.64) in 1986. Fourth-quarter earnings totaled $18.1 million (54 cents), up 50 percent over $12 million (35 cents) a year earlier.

The company said return on average assets reached 0.98 percent, compared to a return of 0.87 percent in 1986. During the year, total assets climbed to $7.6 billion, up 7 percent from $7.1 billion in the previous year.

Strategic Planning Associates, a management-consulting firm based in Washington, said its profits doubled to $1.4 million (34 cents) for the first quarter ended Nov. 30, from a profit of $700,000 (22 cents) a year earlier. Revenue for the quarter rose 46 percent, to $13.2 million, from $9 million a year ago.