diff --git a/INSTALL.txt b/INSTALL.txt
index 4b4e465..1c854dc 100644
--- a/INSTALL.txt
+++ b/INSTALL.txt
@@ -1,4 +1,3 @@
-
 Prerequisite:
 - Java 5 or higher
 
@@ -15,16 +14,16 @@ NOT work!)
 
 [1] http://code.google.com/p/solr-php-client/downloads/list
 
-Afterwards, unpack this archive to this module's directory, so the directory
+Afterwards, unpack this archive to drupal's libraries folder, so the directory
 tree looks like this:
 
-search_api_solr
-|- SolrPhpClient/
-|- INSTALL.txt
-|- README.txt
-  ...
+/path/to/drupal/sites/all/libraries/
+  |- SolrPhpClient
+     |- Apache/
+     |- ChangeLog
+     ...
 
-The library should then be found by Drupal.
+The library should then be found by the module.
 
 Setting up Solr
 ---------------
diff --git a/search_api_solr.info b/search_api_solr.info
index f84dc21..275f7f0 100644
--- a/search_api_solr.info
+++ b/search_api_solr.info
@@ -9,6 +9,3 @@ files[] = service.inc
 files[] = solr_connection.inc
 files[] = solr_field.inc
 files[] = includes/spellcheck.inc
-files[] = SolrPhpClient/Apache/Solr/Document.php
-files[] = SolrPhpClient/Apache/Solr/Response.php
-files[] = SolrPhpClient/Apache/Solr/Service.php
diff --git a/search_api_solr.module b/search_api_solr.module
index 4908356..7b5060f 100644
--- a/search_api_solr.module
+++ b/search_api_solr.module
@@ -1,4 +1,45 @@
 <?php
+/**
+ * @file
+ * Provides a Solr-based service class for the Search API.
+ */
+
+/**
+ * Implements hook_init().
+ */
+function search_api_solr_init() {
+  spl_autoload_register('_search_api_solr_autoload');
+}
+
+/**
+ * Autoloader for the SolrPhpClient classes.
+ */
+function _search_api_solr_autoload($name) {
+  static $path, $lookup_cache = array();
+
+  if (isset($lookup_cache[$name])) {
+    return $lookup_cache[$name];
+  }
+  elseif (substr($name, 0, 11) == 'Apache_Solr') {
+    if (!isset($path)) {
+      foreach (array(dirname(__FILE__), DRUPAL_ROOT . '/sites/all/libraries', NULL) as $path) {
+        if (!$path || is_dir($path .=  '/SolrPhpClient/')) {
+          break;
+        }
+      }
+      if (!$path) {
+        throw new Exception('SolrPhpClient library not found! Please follow the instructions in search_api_solr/INSTALL.txt for installing the Solr search module.');
+      }
+    }
+    if (file_exists($file_path = $path . str_replace('_', '/', $name) . '.php')) {
+      require_once $file_path;
+      $lookup_cache[$name] = TRUE;
+      return TRUE;
+    }
+  }
+  $lookup_cache[$name] = FALSE;
+  return FALSE;
+}
 
 /**
  * Implements hook_search_api_service_info().
