The number of people being taken to court in Scotland has risen for the first time in seven years.

Official statistics show a 4% increase to 121,668 in people proceeded against in 2013-14.

The number of people with a charge proved also rose by 4% to 105,549.

Statisticians said the upturn was due to a 14% increase in the number of people convicted of traffic offences, to 40,258.

This was said to be as a result of Police Scotland focusing on specific crimes including dangerous and careless driving, speeding and seatbelt offences.

The number of people convicted for sexual crimes rose by 22% from 864 in 2012-13 to 1,053.

A rise in the number of sexual offences has been partially attributed to a widening of the definition of rape which came into force in December 2010, as well as increased reporting in the wake of high-profile historic cases.

Convictions for rape and attempted rape increased by 13% to 87 while sexual assault convictions rose 15% to 235.

Rape and attempted rape also saw the highest rate of "not guilty" verdicts, with 37% of the 214 people proceeded against acquitted and a further 20% found not proven.

Meanwhile, convictions for non-sexual crimes of violence fell, with guilty outcomes for homicide and for attempted murder and serious assault dropping 20% in the year to 2013-14.

The number of convictions resulting in a custodial sentence fell by 5% to 14,101 while the average sentence length for all crimes increased by 3%.

Justice Secretary Michael Matheson said the figures should be viewed in light of the latest Police Scotland recorded crime statistics.

He said: "Crime in Scotland has fallen to a 40-year low, violent crime is down 10% and crimes of handling an offensive weapon (including knives) have reduced by 62% since 2006-07."

Mr Matheson highlighted a 7% rise in the average custodial sentence for handling an offensive weapon.

"What today's figures show is that our courts are ensuring that serious offenders receive lengthy prison sentences," he said.

"Overall sentence lengths for serious crimes are up, sentence lengths for all crimes more generally are up and it is pleasing to see that the average sentence on conviction for handling an offensive weapon is now 374 days - up 7% in the past year and three times higher than the average sentence for the same crime in 2004-05."

He added: "Although the number of sexual crimes in Scotland is still unacceptably high, it is encouraging to see that the number of convictions for these crimes is up as we are seeing more victims coming forward and more cases reaching our courts.

"These types of cases can be harder to prove as they are often committed in private.

"However, victims should be assured that our law enforcement agencies and our courts are working hard to tackle these terrible crimes, secure the convictions of the guilty and ensure that they are punished."

Scottish Conservative transport spokesman Alex Johnstone said: "One of Police Scotland's first acts was to do away with its traffic wardens - only to turn the entire force into a traffic warden service.

"People don't share the police's obsession with traffic offences.

"They would much rather see efforts going into reducing violent crime, tackling vandalism and damage to property and focus on housebreaking.

"Instead, Police Scotland seems to be more interested in the easy targets who are Scotland's drivers."