People in a Dundee flat were forced to wrestle a knife-wielding teenager to the ground, it has been alleged.
Prosecutors say 18-year-old Connor Woods pulled a knife from his trouser waistband and brandished it at a group of people.
The group disarmed the teenager before police arrived to arrest him, the court heard.
Woods, of Byron Street in Dundee, appeared in private before Sheriff Derek Reekie on a petition alleging four charges.
He is alleged to have, on April 13 and 14, at Fintryside, possessed a knife.
He is further alleged to have, on April 14 2018, at Fintryside, behaved in a threatening or abusive manner likely to cause fear or alarm, shouted and swore at persons present there, pulled out the knife from his trouser waistband and brandished it at those present and struggled with those present, placing them in a state of fear and alarm.
He is also accused of resisting arrest by three police officers, struggling with them, refusing to have handcuffs placed on him, placing his arms underneath his body and clenching his body tightly, continuing to struggle with them and kicking out with his legs while the officers were trying to place him in a police vehicle, forcing them to use leg restraints.
He is also faced with a charge of breaching a curfew condition of bail by being outwith his home between the hours of 7pm-7am on April 14 2018.
All of these alleged offences are said to have occurred while Woods was on bail.
Woods made no plea and was remanded in custody by Sheriff Reekie.
The case was continued for further examination.