Recorded crime has fallen to its lowest level for almost four decades, but there was a 16% increase in rapes last year.

Police recorded 13% fewer crimes last year, although sexual offences were up 5%.

Justice Secretary Kenny MacAskill said the rise in sexual offences is concerning but that "today's statistics show that Scotland's communities are becoming safer places to live, with recorded crime falling for the sixth year in a row to its lowest level for 39 years".

Police logged 273,053 crimes last year, down from 314,188 in 2011-12, the lowest total since 1974.

There were 7,693 sexual offences in 2012-13, up 332 on 2011-12. This includes 1,372 rapes, up from 1,183.

Non-sexual crimes of violence were down 21%, at 7,530. This includes a 25% drop in homicides, which includes murders, culpable homicides and death by both dangerous driving and careless driving, to a total of 91 last year.

Attempted murders and serious assaults were down 22% to 3,643 while robberies were down 18% to 1,832.

Crimes of dishonesty fell 12% to 135,899, while fireraising, vandalism and other similar crimes were down 21% to 59,479.

Crimes of handling an offensive weapon fell 29% to 4,015, down from 5,631 in 2011-12.

Drugs crimes were down 1% from 35,157 to 34,688 last year.

Mr MacAskill said: "It is particularly encouraging to see violent crime dropping by 21% last year and crimes of handling an offensive weapon down by 60% since 2006-07. However, make no mistake, there will be no let-up in our efforts, backed by record numbers of police officers - over 1,000 extra since 2007 - who are keeping communities safe and clearing up crimes more efficiently than ever before.

"We are continuing to work tirelessly to reduce knife crime and violence in Scotland and believe education and prevention are key to tackling the root causes of violence. That's why we are investing in the No Knives, Better Lives initiative, now in 11 areas across Scotland, and why we work with other key partners like the Violence Reduction Unit and Medics Against Violence.

"Together we are working hard to change attitudes to violence and knife crime, making it clear that it is never acceptable. We are also taking a robust approach to enforcement. Sentences for carrying a knife in Scotland are the toughest in the UK and our prosecutors are taking a zero-tolerance approach.

"Today's figures show these united efforts to tackle knife crime are beginning to pay off but there will be no complacency.

"While today's overall statistics are encouraging, it is concerning to see that the number of sexual offences recorded by police have increased by 5%. This may be down to increased reporting but the public should be assured that the Scottish Government, police and prosecutors take the investigation and prosecution of these traumatic crimes extremely seriously, and are taking action to address them.

He added: "At a Government level, we have strengthened the law around sex crimes by bringing in the Sexual Offences (Scotland) Act 2009. We are also giving £3.6 million funding to support victims of rape from 2012-15.

"Meanwhile the Scottish police service has launched a new National Rape Taskforce to further improve the investigation of rape and other sexual crimes right across the country."

While crime has fallen, police recorded a slight increase in low-level offences, up 1% to 543,768 from the previous year's total of 542,315.

Conservative chief whip John Lamont said the rise in the number of rapes is "extremely worrying".

He said: "While this may be partly due to a greater number of victims willing to come forward, it is clearly very concerning that instances of rape are at an all-time high.

"The Scottish Government must end the automatic early release of rapists from prison to send out a firm message that this horrific crime will be properly punished."

Mr Lamont also highlighted the rise in offences.

"Last year the SNP attempted to hide the overall rise in crime by quietly leaving out the number of offences committed. Kenny MacAskill can spin the figures anyway he likes but the statistics do not lie.

"For the second year in a row the number of reported offences has gone up, with an increase of almost 1,500. And with clear-up rates in some council areas as low as 28%, it suggests our police spend too much time filling in forms and doing back-office work instead of detecting and solving crime.

"The Justice Secretary is conning communities up and down the country by refusing to be straight with the public about the true levels of crime. Until we know the full extent of the problem, we can't effectively tackle crime in Scotland."

Lord Advocate Frank Mulholland QC said he is "heartened by the reported reduction in offensive weapon crimes".

He said: "The Crown Office and Procurator Fiscal Service strengthened its knife crime policy in 2011. The overall aim of the policy was to reduce offending and reoffending and to provide an effective deterrent.

"I hope today's figures are an indication that the deterrent is working and our actions, along with the Scottish Government and Police Scotland, are having a meaningful impact on communities across the country.

"I am confident that keeping knives off our streets has contributed to the reported decrease in the number of homicides which I also welcome. One knife offence is one too many, but one life saved immeasurable."