A Maryland couple who played elaborate “pranks” on their children, then racked up millions of views on YouTube before critics accused them of abuse, could end up losing two of their children after their biological mother obtained a court order for temporary custody.

The Frederick County Sheriff’s Office served the court order on Friday, taking two of the children from Michael and Heather Martin and placing them in the custody of Rose Hall, their biological mother who lives in North Carolina. A hearing to determine permanent custody is expected to be held within a week, Maj. Tim Clarke of the sheriff’s office said on Tuesday.

The parents first defended the videos, posted on the DaddyOFive account with more than 760,000 subscribers, as a harmless family activity that the children enjoyed, but they have gone on an apology tour after widespread criticism emerged in April. In the videos, the couple verbally berated their five school-age children, frequently to the point of tears, while performing stunts like appearing to destroy an Xbox video game system and accusing the children of making messes they had not made.

The videos have been deleted from the account, though other YouTube users have saved the footage.

In a video posted on Monday, Ms. Hall said that it was “very heartbreaking and disturbing to see my kids being abused.” She told The Baltimore Sun that she had not seen her daughter since 2015 or her son since 2014, and that she had had a difficult custody battle with Mr. Martin, her former boyfriend.