Miami and Miami Beach are among the worst cities in South Florida and the United States for first-time homebuyers, according to a study conducted by WalletHub.

Boca Raton ranked No. 29, the highest of all South Florida cities. Pembroke Pines was next at No. 61.

Of 300 cities, Miami Beach ranked No. 298; Miami, No. 294; Pompano Beach, No. 242; Fort Lauderdale, No. 240. West Palm Beach, No. 239 and Hollywood, No. 226. Rankings for other South Florida cities included Sunrise, No. 145; Davie, No. 126; Miramar, No. 122, Coral Springs, No. 112; and Plantation, No. 78.

The study took into account the following metrics: housing affordability, real estate market and living environment.

Among buyers of primary homes, 33 percent were first-time buyers in 2014, according to the National Association of Realtors. The historical average for this demographic has been 40 percent.

Miami Beach had the highest property crime rate, according to the study. Mission Viejo, California had the lowest. Overall, Overland Park in Kansas was the best city for first-time homebuyers. — Katherine Kallergis