The latest figures show 138,813 people attended A&E during the month, of which 95.5% were seen and either admitted, transferred or discharged within four hours.
The figure is up from 94% in May and meets the Scottish Government target for 95% of cases to be dealt with within four hours.
The statistics show 371 (0.3%) of patients spent more than eight hours in an A&E department, and 73 (0.1%) were there for more than 12 hours.
Separate weekly figures also show the 95% target was met in the week ending July 23, with 95.3% of the 25,562 people who attended emergency departments seen within four hours.
A total of 35 people waited more than eight hours, and four were there more than 12 hours.
Health Secretary Shona Robison said: “It is very encouraging that performance across Scotland was above the 95% target for June, and that Scotland’s A&Es have outperformed those in the rest of the UK for more than two years.
“The weekly statistics for core sites are also above that level for the second week in a row.
“These positive results are thanks to the hard work of staff on the ground, both in emergency departments and elsewhere in the health and social care system.
“While we can expect some fluctuation week-to-week depending on seasonal pressures, there has been continued focus on improvements in patient flow.
“For example, we are ensuring more people are discharged before noon and at weekends, helping to reduce delayed discharge, and meaning patients can be admitted to hospital more quickly if required.
“An additional £9 million has been given to boards this year to help them continue these sustainable improvements in unscheduled care.”