Airline passengers nationwide waited an average of less than 10 minutes for security screening during the Independence Day weekend, officials said Tuesday, in what was a sharp contrast to hourslong lines earlier this year.

The wait times at metropolitan area airports were an average of four minutes at LaGuardia, six minutes at Kennedy and seven minutes at Newark Liberty, the Transportation Security Administration said.

The wait times have “been good and improving since the Memorial Day Weekend,” TSA spokeswoman Lisa Farbstein said.

She attributed the improvement to the conversion of many of its half-time TSA officers to full time, the use of overtime for additional staffing and the increased use of canines to help screen passengers for explosives. That allows agents to put those screened by canines into the line usually reserved for those enrolled in its PreCheck program, Farbstein said.

She said there was an incident at LaGuardia that caused brief delays when a passenger ran through an exit lane in Terminal C, shoved a TSA officer out of his way and entered a secure area. She said the man was pursued by TSA agents and eventually arrested by Port Authority police.

That checkpoint was closed for an hour while dogs swept the area where the man had run to ensure he did not leave behind explosive devices, she said. It took about 20 minutes to screen the passengers who were in line, and the incident was not reflected in the average wait time for LaGuardia, she said.