Homebuyers are still landing great rates on mortgages. But thanks to tighter lending regulations, they are paying a lot more when it comes time to close on the loan.

Nationwide, the average cost of closing on a $200,000 loan with a 20% down payment hit $2,539 in June, a 6% increase from a year earlier, according to Bankrate.com.

Homebuyers in Texas are paying far more than that, however, with average closing costs of $3,046 for a $200,000 loan. That's up 23% compared with a year earlier.

In Wisconsin, buyers saw an even bigger hike: They're now paying an average of $2,706, a 28% increase, according to Bankrate's data.

Related: 1 in 3 U.S. adult have 'debt in collections'

Since the mortgage meltdown, federal regulators have implemented new guidelines to make mortgage borrowing safer. Lenders are now required to check a borrower's credit history, make sure they don't carry excessive debt and that they earn enough income to make their payments.

States with the highest mortgage closing costs State Closing costs* Change from June 2013 Texas $3,046 23% Alaska $2,897 8% New York $2,892 24% Hawaii $2,808 -4% Wisconsin $2,706 28%

As a result, lenders now spend more time and manpower on each loan -- and they pass that extra cost on to borrowers.

Related: Best cities for Millennial homebuyers

John Walsh, owner of Total Mortgage, said his company has had to add several services to make sure their loans comply with the new rules. Among them: a fraud check, an automated valuation model and a late credit pull, which is made right before closing.

Bankrate broke down closing costs into two categories. The first, lender origination fees, increased 9% year-over-year to an average of $1,877, Bankrate found. Meanwhile, third-party fees for appraisals, credit reports and other services, remained relatively flat an average of $662.

Related: Mansions for under $1 million

Bankrate did not include other closing costs in its analysis -- such as title search and insurance, taxes, property insurance, association fees, interest and other prepaid items, all of which remain relatively unaffected by the new regulations.

Polyana da Costa, a senior mortgage analyst at Bankrate, said the lenders she has spoken with don't anticipate lowering their fees.