Index: src/wp-admin/includes/class-wp-upgrader.php
===================================================================
--- src/wp-admin/includes/class-wp-upgrader.php	(revision 25052)
+++ src/wp-admin/includes/class-wp-upgrader.php	(working copy)
@@ -347,7 +347,8 @@
 		if ( $enable ) {
 			$this->skin->feedback('maintenance_start');
 			// Create maintenance file to signal that we are upgrading
-			$maintenance_string = '<?php $upgrading = ' . time() . '; ?>';
+			$timeout = apply_filters( 'upgrader_maintenance_mode_timeout', 600 );
+			$maintenance_string = '<?php $upgrading = ' . time() . '; $timeout = '  . intval( $timeout ) . '; ?>';
 			$wp_filesystem->delete($file);
 			$wp_filesystem->put_contents($file, $maintenance_string, FS_CHMOD_FILE);
 		} else if ( !$enable && $wp_filesystem->exists($file) ) {
Index: src/wp-includes/load.php
===================================================================
--- src/wp-includes/load.php	(revision 25052)
+++ src/wp-includes/load.php	(working copy)
@@ -145,11 +145,15 @@
 	if ( !file_exists( ABSPATH . '.maintenance' ) || defined( 'WP_INSTALLING' ) )
 		return;
 
-	global $upgrading;
+	global $upgrading, $timeout;
 
 	include( ABSPATH . '.maintenance' );
-	// If the $upgrading timestamp is older than 10 minutes, don't die.
-	if ( ( time() - $upgrading ) >= 600 )
+
+	if ( empty( $timeout ) )
+		$timeout = 600; // Default of Ten minutes maximum for maintenance mode, overridden in .maintenance
+
+	// If the $upgrading timestamp is older than $timeout seconds, don't die.
+	if ( ( time() - $upgrading ) >= $timeout )
 		return;
 
 	if ( file_exists( WP_CONTENT_DIR . '/maintenance.php' ) ) {
@@ -164,7 +168,7 @@
 		$protocol = 'HTTP/1.0';
 	header( "$protocol 503 Service Unavailable", true, 503 );
 	header( 'Content-Type: text/html; charset=utf-8' );
-	header( 'Retry-After: 600' );
+	header( 'Retry-After: ' . $timeout );
 ?>
 	<!DOCTYPE html>
 	<html xmlns="http://www.w3.org/1999/xhtml"<?php if ( is_rtl() ) echo ' dir="rtl"'; ?>>
