WASHINGTON (AP) - Fannie Mae and Freddie Mac posted strong earnings for the July-September period as the housing market continued to recover. The gains will enable the mortgage giants to finish repaying their taxpayer aid or come close to doing so five years after they were rescued by the government. Fannie reported Thursday that it earned $8.7 billion in the third quarter. Fannie said its earnings were boosted by the rise in home prices during the period, which enabled it to reduce its reserves set aside for losses on mortgages. Fannie will pay a dividend of $8.6 billion to the Treasury next month, bringing its payments to about $114 billion. Freddie posted net income of $30.5 billion for the third quarter. It will have repaid its full $71.3 billion bailout after paying a dividend of $30.4 billion.