diff --git bp-groups/bp-groups-functions.php bp-groups/bp-groups-functions.php
index 3f1d4eb..649f3ac 100644
--- bp-groups/bp-groups-functions.php
+++ bp-groups/bp-groups-functions.php
@@ -1044,8 +1044,9 @@ function groups_update_groupmeta( $group_id, $meta_key, $meta_value ) {
 
 	$meta_key = preg_replace( '|[^a-z0-9_]|i', '', $meta_key );
 
-	if ( is_string( $meta_value ) )
-		$meta_value = stripslashes( esc_sql( $meta_value ) );
+	if ( is_string( $meta_value ) ) {
+		$meta_value = stripslashes( $meta_value );
+	}
 
 	$meta_value = maybe_serialize( $meta_value );
 
diff --git tests/testcases/groups/functions.php tests/testcases/groups/functions.php
index 5fd9b6d..32d6899 100644
--- tests/testcases/groups/functions.php
+++ tests/testcases/groups/functions.php
@@ -269,4 +269,18 @@ class BP_Tests_Groups_Functions extends BP_UnitTestCase {
 
 		$this->assertEquals( 1, groups_get_groupmeta( $g, 'total_member_count' ) );
 	}
+
+	/**
+	 * @group groupmeta
+	 * @ticket 5180
+	 */
+	public function test_groups_update_groupmeta_with_line_breaks() {
+		$g = $this->factory->group->create();
+		$meta_value = 'Foo!
+
+Bar!';
+		groups_update_groupmeta( $g, 'linebreak_test', $meta_value );
+
+		$this->assertEquals( $meta_value, groups_get_groupmeta( $g, 'linebreak_test' ) );
+	}
 }
