Performance at Scotland's A&E units improved in the second week of January, after two of the worst weeks on record.

Statistics showed 85.8% of patients attending emergency departments were dealt with within the four-hour target time.

This was up from 77.9% in the first week of the year and 78% in the run-up to Hogmanay.

There were 2,400 fewer patients attending A&E in the second week of the year than the previous week.

The figures showed there were 22,883 attendances at A&E, the lowest figure since exactly a year ago, when 90% were seen within the target time.

The latest stats showed 552 patients spent more than eight hours in an emergency department and 118 were there for more than 12 hours, both well down on the previous week.

The flu rate for the start of the year was almost five times higher than the same time last year, putting pressure on A&E.

The latest Health Protection Statistics, covering the same period as the A&E figures, said the rate was 114 people per 100,000 reporting a flu-like illness in the week to 14 January.

However, health experts believed the flu rate peaked around this time.

The Scottish government's A&E target is for 95% of patients to be admitted, discharged or transferred within four hours.

If you can't see the NHS Tracker, click or tap here.

Health Secretary Shona Robison said: "Our A&E departments are continuing to be impacted by the pressures and demand of winter, so these improving statistics are a really significant achievement.

"Flu rates in Scotland are currently almost five times higher than the same period last year and hospitals are reporting a high number of people with already-significant care needs contracting flu, which is increasing demand even further.

"We still have a few months of winter left and there's no doubt we've still got some challenging weeks ahead, particularly with the bad weather we're experiencing, but I'd like to say than you once again to health staff right across Scotland for their continued dedication and hard work."

Labour health spokesman Anas Sarwar said: "While this is a welcome improvement on last week, the reality is the first fortnight of 2018 has been incredibly challenging for our health service.

"Almost 9,000 patients have waited longer than the 4-hour standard the SNP set our NHS, and more than 2,000 have waited over eight hours. These are staggering figures for a two-week period."

Liberal Democrat health spokesman Alex Cole-Hamilton said: "The target for A&E attendees to be seen within four hours has now not been hit since July."