diff --git src/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php src/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php
index 884e5f60f3..a9565d91d3 100644
--- src/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php
+++ src/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php
@@ -669,11 +669,19 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
 		}
 
 		if ( isset( $request['parent'] ) && ! empty( $schema['properties']['parent'] ) ) {
-			$parent_term_id = 0;
-			$parent_term    = get_term( (int) $request['parent'], $this->taxonomy );
+			$parent_term_id   = 0;
+			$requested_parent = (int) $request['parent'];
 
-			if ( $parent_term ) {
-				$parent_term_id = $parent_term->term_id;
+			if ( 0 === $requested_parent ) {
+				$parent_term_id = $requested_parent;
+			}
+
+			if ( $requested_parent ) {
+				$parent_term = get_term( $requested_parent, $this->taxonomy );
+
+				if ( $parent_term instanceof WP_Term ) {
+					$parent_term_id = $parent_term->term_id;
+				}
 			}
 
 			$prepared_term->parent = $parent_term_id;
diff --git tests/phpunit/tests/rest-api/rest-categories-controller.php tests/phpunit/tests/rest-api/rest-categories-controller.php
index 79add82cde..6d9a29dfc0 100644
--- tests/phpunit/tests/rest-api/rest-categories-controller.php
+++ tests/phpunit/tests/rest-api/rest-categories-controller.php
@@ -854,6 +854,18 @@ class WP_Test_REST_Categories_Controller extends WP_Test_REST_Controller_Testcas
 		$this->assertErrorResponse( 'rest_term_invalid', $response, 400 );
 	}
 
+	public function test_create_item_with_no_parent() {
+		wp_set_current_user( self::$administrator );
+		$parent = 0;
+		$request = new WP_REST_Request( 'POST', '/wp/v2/categories' );
+		$request->set_param( 'name', 'My Awesome Term' );
+		$request->set_param( 'parent', $parent );
+		$response = rest_get_server()->dispatch( $request );
+		$this->assertEquals( 201, $response->get_status() );
+		$data = $response->get_data();
+		$this->assertEquals( $parent, $data['parent'] );
+	}
+
 	public function test_update_item() {
 		wp_set_current_user( self::$administrator );
 		$orig_args = array(
@@ -924,6 +936,33 @@ class WP_Test_REST_Categories_Controller extends WP_Test_REST_Controller_Testcas
 		$this->assertEquals( $parent->term_id, $data['parent'] );
 	}
 
+	public function test_update_item_remove_parent() {
+		wp_set_current_user( self::$administrator );
+
+		$old_parent_term = get_term_by( 'id', $this->factory->category->create(), 'category' );
+		$new_parent_id   = 0;
+
+		$term = get_term_by(
+			'id',
+			$this->factory->category->create(
+				[
+					'parent' => $old_parent_term->term_id,
+				]
+			),
+			'category'
+		);
+
+		$this->assertEquals( $old_parent_term->term_id, $term->parent );
+
+		$request = new WP_REST_Request( 'POST', '/wp/v2/categories/' . $term->term_id );
+		$request->set_param( 'parent', $new_parent_id );
+		$response = rest_get_server()->dispatch( $request );
+		$this->assertEquals( 200, $response->get_status() );
+
+		$data = $response->get_data();
+		$this->assertEquals( $new_parent_id, $data['parent'] );
+	}
+
 	public function test_update_item_invalid_parent() {
 		wp_set_current_user( self::$administrator );
 		$term = get_term_by( 'id', $this->factory->category->create(), 'category' );
