Index: src/wp-includes/class.wp-styles.php
===================================================================
--- src/wp-includes/class.wp-styles.php	(revision 25745)
+++ src/wp-includes/class.wp-styles.php	(working copy)
@@ -87,10 +87,10 @@
 
 		if ( $this->do_concat ) {
 			$this->print_html .= $tag;
-			$this->print_html .= $this->print_inline_style( $handle, false );
+			$this->print_html .= sprintf( "<style type='text/css'>\n%s\n</style>\n", $this->print_inline_style( $handle, false ) );
 		} else {
 			echo $tag;
-			echo $this->print_inline_style( $handle, false );
+			$this->print_inline_style( $handle );
 		}
 
 		return true;
Index: src/wp-includes/functions.wp-styles.php
===================================================================
--- src/wp-includes/functions.wp-styles.php	(revision 25745)
+++ src/wp-includes/functions.wp-styles.php	(working copy)
@@ -71,6 +71,11 @@
 		$wp_styles = new WP_Styles();
 	}
 
+	if ( false !== stripos( $data, '</style>' ) ) {
+		_doing_it_wrong( __FUNCTION__, 'Do not pass <style> tags to wp_add_inline_style()', '3.7' );
+		$data = preg_replace( '#<style[^>]*>(.*)</style>#i', '$1', $data );
+	}
+
 	return $wp_styles->add_inline_style( $handle, $data );
 }
 
Index: tests/phpunit/tests/dependencies/styles.php
===================================================================
--- tests/phpunit/tests/dependencies/styles.php	(revision 25745)
+++ tests/phpunit/tests/dependencies/styles.php	(working copy)
@@ -86,4 +86,89 @@
 		// Cleanup
 		$wp_styles->base_url = $base_url_backup;
 	}
+
+	/**
+	 * Test if inline styles work
+	 * @ticket 24813
+	 */
+	public function test_inline_styles() {
+
+		$expected  = "<link rel='stylesheet' id='handle-css'  href='http://example.com?ver=1' type='text/css' media='all' />\n";
+		$expected .= "<style type='text/css'>\n";
+		$expected .= "background: red\n";
+		$expected .= "</style>\n";
+
+		wp_enqueue_style( 'handle', 'example.com', array(), 1 );
+		wp_add_inline_style( 'handle', 'background: red' );
+
+		// No styles left to print
+		$this->assertEquals( $expected, get_echo( 'wp_print_styles' ) );
+	}
+
+	/**
+	 * Test if inline styles work with concatination
+	 * @global WP_Styles $wp_styles
+	 * @ticket 24813
+	 */
+	public function test_inline_styles_concat() {
+
+		global $wp_styles;
+
+		$wp_styles->do_concat = true;
+		$wp_styles->default_dirs = array( '/wp-admin/', '/wp-includes/css/' ); // Default dirs as in wp-includes/script-loader.php
+
+		wp_enqueue_style( 'handle', 'example.com', array(), 1 );
+		wp_add_inline_style( 'handle', 'background: red' );
+
+		$expected  = "<link rel='stylesheet' id='handle-css'  href='http://example.com?ver=1' type='text/css' media='all' />\n";
+		$expected .= "<style type='text/css'>\n";
+		$expected .= "background: red\n";
+		$expected .= "</style>\n";
+
+		wp_print_styles();
+		$this->assertEquals( $expected, $wp_styles->print_html );
+
+	}
+
+	/**
+	 * Test if multiple inline styles work
+	 * @ticket 24813
+	 */
+	public function test_multiple_inline_styles() {
+
+		$expected  = "<link rel='stylesheet' id='handle-css'  href='http://example.com?ver=1' type='text/css' media='all' />\n";
+		$expected .= "<style type='text/css'>\n";
+		$expected .= "background: red\n";
+		$expected .= "background: green\n";
+		$expected .= "</style>\n";
+
+		wp_enqueue_style( 'handle', 'example.com', array(), 1 );
+		wp_add_inline_style( 'handle', 'background: red' );
+		wp_add_inline_style( 'handle', 'background: green' );
+
+		// No styles left to print
+		$this->assertEquals( $expected, get_echo( 'wp_print_styles' ) );
+
+	}
+
+	/**
+	 * Test if a plugin doing it the wrong way still works
+	 * @ticket 24813
+	 */
+	public function test_plugin_doing_inline_styles_wrong() {
+
+		$expected = "<link rel='stylesheet' id='handle-css'  href='http://example.com?ver=1' type='text/css' media='all' />\n";
+		$expected .= "<style type='text/css'>\n";
+		$expected .= "background: red\n";
+		$expected .= "</style>\n";
+
+		wp_enqueue_style( 'handle', 'example.com', array(), 1 );
+
+		// Surpress _doing_it_wrong error
+		@wp_add_inline_style( 'handle', '<style>background: red</style>' );
+
+		$this->assertEquals( $expected, get_echo( 'wp_print_styles' ) );
+
+	}
+
 }
